Home » excel » excel – Shifting single row data to single column

excel – Shifting single row data to single column

Posted by: admin May 14, 2020 Leave a comment

Questions:

I am trying to store the cell array val as a Excel file (xls). This cell array has a structure of 1 x 62328.

val=

Column 1 through 4

{'data1'}   {'data2'}   {'data3'}

Column 5 through 8

{'data4'}   {'data5'}   {'data5'}

and so on up to 62328 columns.

As Excel doesn’t support this large amount of columns, so how do I write the data into a single column instead?

How to&Answers:

You can transpose a cell array by simply adding .' after it.

When you then write your cell array down to a xls file just insert val.' instead of val.