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

correction d'un bug a la lecture qui dupliquait le tableau de char des...

correction d'un bug a la lecture qui dupliquait le tableau de char des variables _CALCOEFF_CONV lorsque la variables des coefficients associées était nulle
parent d25d26b3
No related branches found
No related tags found
No related merge requests found
......@@ -18,12 +18,17 @@ tsg = getappdata( hMainFig, 'tsg_data');
% -----------------------------
var = {'SSJT_CALCOEF', 'CNDC_CALCOEF', 'SSTP_CALCOEF'};
% define coefficients names
% -------------------------
coeff_type = {{'DATE','A','B','C','D','F0',''},{'DATE','A','B','C','D','M','CPCOR'},...
{'DATE','A','B','C','D','F0',''}; ...
{'DATE','G','H','I','J','F0',''},{'DATE','G','H','I','J','CTCOR','CPCOR'},...
{'DATE','G','H','I','J','F0',''}};
% define coefficients names, celle array with first element with size
% COEF_CONV_SIZE
% -------------------------------------------------------------------
coeff_type = ...
{{padding('DATE',tsg.dim.COEF_CONV_SIZE);'A';'B';'C';'D';'F0';''},...
{padding('DATE',tsg.dim.COEF_CONV_SIZE);'A';'B';'C';'D';'M';'CPCOR'},...
{padding('DATE',tsg.dim.COEF_CONV_SIZE);'A';'B';'C';'D';'F0';''}; ...
{padding('DATE',tsg.dim.COEF_CONV_SIZE);'G';'H';'I';'J';'F0';''},...
{padding('DATE',tsg.dim.COEF_CONV_SIZE);'G';'H';'I';'J';'CTCOR';'CPCOR'},...
{padding('DATE',tsg.dim.COEF_CONV_SIZE);'G';'H';'I';'J';'F0';''}
};
% get preference choice for cabrations type popup
% -----------------------------------------------
......@@ -36,17 +41,16 @@ for i = 1:numel(var)
tsg.([var{i} '_CONV']) = [];
for j = 1:tsg.dim.CALCOEF
tsg.(var{i})(j) = NaN;
tsg.([var{i} '_CONV']) = ...
[tsg.([var{i} '_CONV']); padding(coeff_type{pref,i}{j}, tsg.dim.COEF_CONV_SIZE)];
end
elseif isnan(tsg.(var{i}))
tsg.([var{i} '_CONV']) = [];
for j = 1:tsg.dim.CALCOEF
tsg.(var{i})(j) = NaN;
tsg.([var{i} '_CONV']) = ...
[tsg.([var{i} '_CONV']); padding(coeff_type{pref,i}{j}, tsg.dim.COEF_CONV_SIZE)];
end
end
% convert cell array of string to char array
% ------------------------------------------
tsg.([var{i} '_CONV']) = char(coeff_type{pref,i});
end
% Save tsg structure
......
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