Exporting uneven nested cells to excel

5 visualizaciones (últimos 30 días)
aaammm
aaammm el 3 de Mzo. de 2023
Comentada: aaammm el 10 de Mzo. de 2023
I have a 1x50 nested cell array where each cell has 3 columns but different number of rows that I need to export to excel.
I already have a loop to obtain the nested cell variable so I am using xlswrite('mydata.xlsx',data,'Sheet1') in the loop.
How can I move columns so the data is not overwritten in columns A:C for every iteration?
  1 comentario
Voss
Voss el 5 de Mzo. de 2023
You can set the Range of cells to be written to (xlswrite(filename,A,sheet,xlRange)), which you would adjust on each iteration of the loop.
However, it's likely easier to write the entire file once, without a loop at all.
Can you save your cell array in a .mat file and upload it here (using the paperclip button), and also share any code you have written so far for this?

Iniciar sesión para comentar.

Respuestas (1)

Swaraj
Swaraj el 6 de Mzo. de 2023
Xlswrite is not recommended. Go through the below documentation.
You can go for “writecell” function. We can use it to specify range within which[JK1] we want to write data.
To avoid overwriting data in columns A:C for every iteration, you can use the Range input argument of the “writecell” function to specify the starting cell for each iteration
For example :
writecell(C,'C.xls','Sheet',2,'Range','A3:C5')
Go through the below documentation for further details.
  1 comentario
aaammm
aaammm el 10 de Mzo. de 2023
I've already tried writecell and it doesn't work if the cells have different sizes. The longest column is also 105k rows

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by