Skip to content
Snippets Groups Projects
Commit b972c344 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Changed local variable name (index of the main loop).

parent f6a1df85
No related branches found
No related tags found
No related merge requests found
...@@ -86,30 +86,32 @@ data = []; ...@@ -86,30 +86,32 @@ data = [];
varlist = {}; varlist = {};
if isempty(varlist0) if isempty(varlist0)
for i=1:length(list_of_variables) for current_variable_index=1:length(list_of_variables)
if isequal(list_of_variables(i).name,'freq') || isequal(list_of_variables(i).name,'time') || isequal(list_of_variables(i).name,'data') ... if isequal(list_of_variables(current_variable_index).name,'freq') ...
|| isequal(list_of_variables(i).name,'varlist') ... || isequal(list_of_variables(current_variable_index).name,'time') ...
|| isequal(list_of_variables(i).name,'varlist0') ... || isequal(list_of_variables(current_variable_index).name,'data') ...
|| isequal(list_of_variables(i).name,'list_of_variables') ... || isequal(list_of_variables(current_variable_index).name,'varlist') ...
|| isequal(list_of_variables(i).name,'tex') ... || isequal(list_of_variables(current_variable_index).name,'varlist0') ...
|| isequal(list_of_variables(current_variable_index).name,'list_of_variables') ...
|| isequal(list_of_variables(current_variable_index).name,'tex') ...
continue continue
end end
if list_of_variables(i).global || list_of_variables(i).persistent if list_of_variables(current_variable_index).global || list_of_variables(current_variable_index).persistent
continue continue
end end
if list_of_variables(i).complex || ~strcmp(list_of_variables(i).class,'double') if list_of_variables(current_variable_index).complex || ~strcmp(list_of_variables(current_variable_index).class,'double')
continue continue
end end
try try
eval(['data = [data, ' list_of_variables(i).name '];']) eval(['data = [data, ' list_of_variables(current_variable_index).name '];'])
eval(['varlist = {varlist{:}, ''' list_of_variables(i).name '''};']) eval(['varlist = {varlist{:}, ''' list_of_variables(current_variable_index).name '''};'])
catch catch
error(['load_m_file:: All the vectors (variables) in ' inputname(1) ' must have the same number of rows (observations)!']) error(['load_m_file:: All the vectors (variables) in ' inputname(1) ' must have the same number of rows (observations)!'])
end end
end end
else else
for i=1:length(varlist0) for current_variable_index=1:length(varlist0)
eval(['data = [data, ' varlist0{i} '];']) eval(['data = [data, ' varlist0{current_variable_index} '];'])
end end
varlist = varlist0; varlist = varlist0;
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment