From 79172dc42d54fcf399398bad22d147debfdcb741 Mon Sep 17 00:00:00 2001 From: Olivier Sauter <olivier.sauter@epfl.ch> Date: Sat, 10 Aug 2024 08:46:58 +0200 Subject: [PATCH] fix in case of empty shot call to gdat (for ids empty) --- matlab/gdat.m | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/matlab/gdat.m b/matlab/gdat.m index e21551bf..99271c74 100644 --- a/matlab/gdat.m +++ b/matlab/gdat.m @@ -190,14 +190,18 @@ try % treat multiple shot numbers if nargin > 0 && isnumeric(shot) args_in = args; - for i=1:numel(shot) - args{1} = shot(i); - [gdat_data_i,gdat_params,error_status(i),varargout] = feval(['gdat_' lower(machine_eff)],args{:}); - gdat_data_i.gdat_params.machine = lower(gdat_data_i.gdat_params.machine); - gdat_data(i) = gdat_data_i; + if ~isempty(shot) + for i=1:numel(shot) + args{1} = shot(i); + [gdat_data_i,gdat_params,error_status(i),varargout_gdat] = feval(['gdat_' lower(machine_eff)],args{:}); + gdat_data_i.gdat_params.machine = lower(gdat_data_i.gdat_params.machine); + gdat_data(i) = gdat_data_i; + end + else + [gdat_data,gdat_params,error_status,varargout_gdat] = feval(['gdat_' lower(machine_eff)],args{:}); end else - [gdat_data,gdat_params,error_status,varargout] = feval(['gdat_' lower(machine_eff)],args{:}); + [gdat_data,gdat_params,error_status,varargout_gdat] = feval(['gdat_' lower(machine_eff)],args{:}); % because data request can be an actual detailed tree related signal, upper and lower case need to be kept, but other places remain with lower case when case insensitive % needed since some substructure have machine name like mapping_for gdat_data.gdat_params.machine = lower(gdat_data.gdat_params.machine); -- GitLab