using fprintf to print selected rows from an excel file?
6 ビュー (過去 30 日間)
古いコメントを表示
i'm trying to use fprintf to print all three columns of an excel file, but only the first five rows. how do i go about this? thank you.
2 件のコメント
Walter Roberson
2016 年 9 月 6 日
Insufficient information about the data types of the columns. Does "first five rows" include one or more header lines? Are any of the columns dates?
回答 (1 件)
Keith Hooks
2016 年 9 月 6 日
You could do something like this:
[len, width] = size(q);
for row = 1:len
fprintf('%d %s %s\n', q{row,1}, q{row,2}, q{row,3})
end
I made some assumptions about your data types. You might want to customize the %d, %s placeholders to your needs.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!