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!