Is there a way to run a loop through subfiles in a file?
1 view (last 30 days)
Show older comments
Coral Reyes
on 30 Jun 2015
Answered: Image Analyst
on 30 Jun 2015
So I saved an excel workbook into matlab format . The excel document had multiple sheets and each of those sheets was created into a subfile of the saved data file. Each of those subfiles has values I need to run into a code individually (like in a for loop) but I don't know how to write the file in a way the code recognizes it has to go through each and every single subfile . An example of what I did to convert my excel workbook and give each sheet a name is provided.
So DATA0 contains RAW and DATA. but RAW has subfiles called RAW.RAW1, RAW.RAW2 , RAW.RAW3, etc.
I want to add to my code a way to loop through those RAW.RAW# and get the values necessary to run the program.
I hope I was able to explain my problem.
if true
clc, clear, close
[NUM,TXT,DATA]=xlsread('ACTE Flight Maneuvers v21.xlsx',5);
for kk=1:length(NUM) kks = num2str(kk);
[VAL,TXT2,RAW0]=xlsread('ACTE Flight 19 -Flow Analysis.xlsx',kk,'A2:C69'); raws = cat(2,'RAW',kks); RAW.(raws) = RAW0;
end
save DATA0 DATA RAW
load DATA0 end
0 Comments
Accepted Answer
Image Analyst
on 30 Jun 2015
See the FAQ for a couple of code samples: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
0 Comments
More Answers (0)
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!