Effacer les filtres
Effacer les filtres

assigning a variable name with prefix from a loop read to an array

3 vues (au cours des 30 derniers jours)
Philip
Philip le 10 Juil 2014
Commenté : José-Luis le 10 Juil 2014
for j=109:110 % create a filename for loop read ExcelFileName = sprintf('%d_IF.csv', j); ExcelSheetName = sprintf('%d_IF',j); % Mod_IF = xlsread(ExcelFileName,ExcelSheetName,'B22:B100021'); % end % what I want to do is read in 109_IF.csv, 109_IF sheet from B22 to B100021 % As far as I can tell that is occuring because I can look at Mod_IF and % it has the correct values. % % I would like to save the data into Mod_IF_109 on the first loop % and then save the data on the second read into Mod_IF_110 and so on % % I have not found a way to do that, I have tried eval, S., newname % and so on, but each time I tried to access the data outside the % loop an error occurs that says function or variable Mod_IF_109 is undefine % and I do not see Mod_IF_109 array in the workspace being created. % % Looking at the FAQs and the other have, the solutions are close % but I have not been able to get them to get past the error, in fact % the above came from a FAQ but the FAQ did not elaborate on how to % save the data into an array that is identified by the j value. % % Using a multi-column array is NOT an option i.e (10000x(number of % reads in the loop) for various reasons % Thanks for any advance %Regards %Philip
  3 commentaires
Philip
Philip le 10 Juil 2014
Yes, I have edited the question sorry I did not look at the preview before submitting, thanks. Regards, Philip
José-Luis
José-Luis le 10 Juil 2014
I'm sorry but you haven't.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by