How do I transpose numerical and text data in excel from columns to rows?
7 views (last 30 days)
Show older comments
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 Comment
Bob Thompson
on 22 Nov 2019
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.
Answers (0)
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!