Commit 8e73289f authored by Johannes Pfeifer 's avatar Johannes Pfeifer Committed by Stéphane Adjemian

read_variables.m: consistently account for variables being stored as cell array

parent 0a80ca40
...@@ -91,7 +91,7 @@ switch (extension) ...@@ -91,7 +91,7 @@ switch (extension)
case { '.xls', '.xlsx' } case { '.xls', '.xlsx' }
[freq,init,data,varlist] = load_xls_file_data(fullname,xls_sheet,xls_range); [freq,init,data,varlist] = load_xls_file_data(fullname,xls_sheet,xls_range);
for dyn_i_01=1:var_size_01 for dyn_i_01=1:var_size_01
iv = strmatch(strtrim(var_names_01(dyn_i_01,:)),varlist,'exact'); iv = strmatch(strtrim(var_names_01{dyn_i_01}),varlist,'exact');
if ~isempty(iv) if ~isempty(iv)
dyn_tmp_01 = [data(:,iv)]'; dyn_tmp_01 = [data(:,iv)]';
if length(dyn_tmp_01) > dyn_size_01 && dyn_size_01 > 0 if length(dyn_tmp_01) > dyn_size_01 && dyn_size_01 > 0
...@@ -101,7 +101,7 @@ switch (extension) ...@@ -101,7 +101,7 @@ switch (extension)
dyn_data_01(:,dyn_i_01) = dyn_tmp_01; dyn_data_01(:,dyn_i_01) = dyn_tmp_01;
else else
cd(old_pwd) cd(old_pwd)
error([strtrim(var_names_01(dyn_i_01,:)) ' not found in ' fullname]) error([strtrim(var_names_01{dyn_i_01}) ' not found in ' fullname])
end end
end end
case '.csv' case '.csv'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment