How do I transpose numerical and text data in excel from columns to rows?
조회 수: 7 (최근 30일)
이전 댓글 표시
Hi all,
I have an excel spreadsheet that has numerical and text data writen both column wise and row wise. Using matlab, my task is to read and rewrite the spreadsheet so that it all will read column wise. The columns in green are acceptable. The blue columns must be transposed to read as a row and moved up one row.

Thanks!
댓글 수: 1
Bob Thompson
2019년 11월 22일
I don't entire understand how your final data will be structured, would you mind explaining that a bit more?
That being said, I would suggest splitting the final column off from the rest of the data. If the first four columns are fine, then you can just write them back out with xlswrite, but you might want to write the final column as a separate command.
Transposing matrices in MATLAB can be accomplished with '.
>> A = [1 2 3];
>> A'
ans =
1
2
3
This should also work for cell matrices, or whatever class you have. Tables might be more interesting, but I would imagine the process would be similar.
답변 (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!