importing excel data using for loop
Show older comments
I have been collecting data which is in a .xlsx format and am attempting to do some analysis using matlab. I have been trying to import all of the data using a single loop, but am having some issues with the syntax. I am trying to do:
for kk=1:24
f(kk,:) = readtable(sprintf('C:\Users\zschneider\Documents\MATLAB\Data\Point %d.xlsx', 'Sheet',1, 'Range','A10:A3024',kk));
end
In this line I am trying to accomplish reading table data for measurement point 1 to 24. I am able to use the readtable and get the data I want, I am just struggling to use an sprintf command to index the string element of the file name. Let me know if you have any questions or comments on a better way to do this. Thanks!
Accepted Answer
More Answers (0)
Categories
Find more on Data Import from MATLAB 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!