How to read spreadsheet files iteratively?
4 ビュー (過去 30 日間)
古いコメントを表示
I am trying to access .xls files that are indexed in the following approach:
for a=1:5
filename = sprintf('%s_%d','Set_90',a);
fname=readtable('filename.xls');
But obviously, 'readtable' function is calling a file named 'filename.xls' and not 'Set_90_1.xls' . How do I change the code, in order to call the latter?
Thanks.
0 件のコメント
採用された回答
per isakson
2020 年 5 月 9 日
Replace
readtable('filename.xls');
by
readtable( [ filename, '.xls' ] );
to use the value of the variable not its name.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!