Skip to content
Snippets Groups Projects
Commit 5debf6cb authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

bug correction from D. Diverres on headerForm.m coefficients

all coefficient was in single type instead double: corrected
when coefficient was read from tsg struct, precision was loose with num2str
just add format '%f' to have 6 decimal
value = num2str(tsg.(var)(ii),'%f');
parent c9dc431b
No related branches found
No related tags found
No related merge requests found
......@@ -362,9 +362,9 @@ uiwait(hHeaderFig);
case 'char'
p_i.(key) = tsg.(key);
case 'byte'
p_i.(key) = int8(str2num(tsg.(key)));
p_i.(key) = int8(str2double(tsg.(key)));
case 'integer'
p_i.(key) = int16(str2num(tsg.(key)));
p_i.(key) = int16(str2double(tsg.(key)));
case 'float'
p_i.(key) = single(str2double(tsg.(key)));
case 'double'
......@@ -388,7 +388,7 @@ uiwait(hHeaderFig);
% -------------------------------------------------------------
for kk = add_var
key = char(kk);
tsg.(key) = single(str2double(get(data.(key), 'string')));
tsg.(key) = str2double(get(data.(key), 'string'));
p_i.(key) = tsg.(key);
end
......@@ -409,9 +409,9 @@ uiwait(hHeaderFig);
tsg.(var)(ii) = NaN;
else
if strcmpi(key, 'DATE')
tsg.(var)(ii) = single(datenumToJulian(datenum(s, 'yyyymmdd')));
tsg.(var)(ii) = double(datenumToJulian(datenum(s, 'yyyymmdd')));
else
tsg.(var)(ii) = single(str2double(s));
tsg.(var)(ii) = double(str2double(s));
end
end
%p_i.(key) = tsg.(key);
......@@ -661,7 +661,7 @@ uiwait(hHeaderFig);
elseif strcmpi(cle, padding('DATE', tsg.dim.COEF_CONV_SIZE))
value = datestr(julianToDatenum(tsg.(var)(ii)), 'yyyymmdd');
else
value = num2str(tsg.(var)(ii));
value = num2str(tsg.(var)(ii),'%f');
end
% concate variable name with key: eg SSJT_CALCOEF_H
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment