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!