From 123e1f2afc198ded8cee6ccf9ed77f36d6dedbfc Mon Sep 17 00:00:00 2001 From: Olivier Sauter <olivier.sauter@epfl.ch> Date: Mon, 10 Feb 2025 22:08:02 +0100 Subject: [PATCH] add case Attributes provided but not shot --- matlab/CHDF/cdf2mat.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/matlab/CHDF/cdf2mat.m b/matlab/CHDF/cdf2mat.m index 270ded91..1deaca82 100644 --- a/matlab/CHDF/cdf2mat.m +++ b/matlab/CHDF/cdf2mat.m @@ -136,7 +136,15 @@ end if ~isempty(allinfo.Attributes) top_attr_names = {allinfo.Attributes(:).Name}; ij = strmatch('shot',top_attr_names,'exact'); - cdf2mat_out.shot = allinfo.Attributes(ij).Value; + if ~isempty(ij) + cdf2mat_out.shot = allinfo.Attributes(ij).Value; + else + if nargin>1 && isnumeric(varargin{1}) + cdf2mat_out.shot = varargin{1}; + else + cdf2mat_out.shot = NaN; + end + end else if nargin>1 && isnumeric(varargin{1}) cdf2mat_out.shot = varargin{1}; -- GitLab