diff --git a/crpptbx/TCV/gdat_tcv.m b/crpptbx/TCV/gdat_tcv.m index c11a752b88155051fcd69fa7a1e4513207c885fc..0c02f70198c4b1d0a3a52d699ae998d28cb92875 100644 --- a/crpptbx/TCV/gdat_tcv.m +++ b/crpptbx/TCV/gdat_tcv.m @@ -1098,15 +1098,15 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') disp('need an ids name in ''source'' parameter'); disp('check substructure gdat_params.source_available for an ids list'); end - ids_gen_ok = exist('ids_gen'); + ids_gen_ok = ~isempty(which('ids_gen')); ids_empty = struct([]); - if ids_gen_ok ~= 2 + if ~ids_gen_ok ids_struct_saved = '/home/sauter/matlab/gdat_develop/crpptbx/TCV_IMAS/ids_structures_20190312.mat'; if ~exist(ids_struct_saved,'file') warning(['function ids_gen not available neither file ids_structures_20190312.mat thus cannot create empty ids: ids_gen(''' ids_top_name ''')']); return else - eval(['load ' ids_struct_saved]) + load(ids_struct_saved) if isfield(ids_structures,ids_top_name) ids_empty = ids_structures.(ids_top_name); else @@ -1122,7 +1122,7 @@ elseif strcmp(mapping_for_tcv.method,'switchcase') end try if ~isempty(shot) - eval(['[ids_top,ids_top_description]=tcv_get_ids_' ids_top_name '(shot,ids_empty,gdat_data.gdat_params);']) + [ids_top,ids_top_description] = feval(['tcv_get_ids_' ids_top_name],shot,ids_empty,gdat_data.gdat_params); gdat_data.(ids_top_name) = ids_top; gdat_data.([ids_top_name '_description']) = ids_top_description; else