importing excel data using for loop
显示 更早的评论
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!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Data Import from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!