How to create for loop for more than 1 file in path?
3 views (last 30 days)
Show older comments
Hi everyone, I'm currently trying to analyze all 6 data and have them all on 1 plot. I'm not sure what to put in my for loop that can go through each of the 6 files that I have in paths, and each of the file have a different name, color, and length style
I put the link to my code here https://docs.google.com/document/d/1S0iG7YM5812pc4P7GhpqS_tzip_tvbAz0R4I984omWg/edit?usp=sharing
Thank you for all your help!
0 Comments
Answers (1)
Sulaymon Eshkabilov
on 20 Mar 2022
You exercise can be solved using a simple for loop, e.g.:
G = ["C:\...\ANOVA.xlsx";
"C:\...\Data.xlsx";
"C:\...\DAT1.xlsx";
"C:\...\DAT2.xlsx";
"C:\...\D_Excel.xlsx";];
for ii = 1:numel(G)
winopen(G(ii)); % Open/View all files
ALL{ii} = readmatrix(G(ii)); % Get all data from the files
...
end
0 Comments
See Also
Categories
Find more on Loops and Conditional Statements 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!