From b972c344179043bfda446e82b80bffd98d7c261f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Scylla=29?= <stephane.adjemian@univ-lemans.fr> Date: Wed, 27 Aug 2014 17:45:10 +0200 Subject: [PATCH] Changed local variable name (index of the main loop). --- matlab/load_m_file_data.m | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/matlab/load_m_file_data.m b/matlab/load_m_file_data.m index 20e1b28a77..637301c166 100644 --- a/matlab/load_m_file_data.m +++ b/matlab/load_m_file_data.m @@ -86,30 +86,32 @@ data = []; varlist = {}; if isempty(varlist0) - for i=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') ... - || isequal(list_of_variables(i).name,'varlist') ... - || isequal(list_of_variables(i).name,'varlist0') ... - || isequal(list_of_variables(i).name,'list_of_variables') ... - || isequal(list_of_variables(i).name,'tex') ... + for current_variable_index=1:length(list_of_variables) + if isequal(list_of_variables(current_variable_index).name,'freq') ... + || isequal(list_of_variables(current_variable_index).name,'time') ... + || isequal(list_of_variables(current_variable_index).name,'data') ... + || isequal(list_of_variables(current_variable_index).name,'varlist') ... + || 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 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 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 end try - eval(['data = [data, ' list_of_variables(i).name '];']) - eval(['varlist = {varlist{:}, ''' list_of_variables(i).name '''};']) + eval(['data = [data, ' list_of_variables(current_variable_index).name '];']) + eval(['varlist = {varlist{:}, ''' list_of_variables(current_variable_index).name '''};']) catch error(['load_m_file:: All the vectors (variables) in ' inputname(1) ' must have the same number of rows (observations)!']) end end else - for i=1:length(varlist0) - eval(['data = [data, ' varlist0{i} '];']) + for current_variable_index=1:length(varlist0) + eval(['data = [data, ' varlist0{current_variable_index} '];']) end varlist = varlist0; end -- GitLab