How do I transpose numerical and text data in excel from columns to rows?

7 Ansichten (letzte 30 Tage)
dbrad
dbrad am 22 Nov. 2019
Kommentiert: Bob Thompson am 22 Nov. 2019
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.
task.PNGCurrently, I already have the file imported and can read the data using [n,t,r]. I'm guessing the next steps are to change the table to arrays and work from there?
Thanks!
  1 Kommentar
Bob Thompson
Bob Thompson am 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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by