write table to .xls document with variable (cell array) not splitting into different cells
Afficher commentaires plus anciens
Hi,
I am having some trouble with writetable into a .xls document and would like to ask for your help.
I have a table A with many variables as below.
A = [Case Load_Type elements X1 PX1 PY1 PZ1 X2 PX2 PY2 PZ2 glob np relative al be ga memo]
Please see pic below and find the table attached.

when I write it to excel I use
writetable(A,'Table.xls','Sheet',1,'Range','A1')
All cells are correctly written except for elements which uses a single separate cell ,column for each number.

I would like to get all elements into one cell as below

How could I define the elements column in matlab so that it keeps all numbers for each single (row,column) separated by a space and in the same cell when writing table to .xls?
Thank you in advance.
2 commentaires
Guillaume
le 26 Juil 2019
Excel does not support having several numbers in the same cell, hence matlab distributes the numbers in contiguous cells.
The alternative is converting the numbers to text and concatenate the textual representations with a suitable separator (space?, comma?) so that they can be written into the same cell. The value of that is dubious since excel will treat the content of the cells as text so won't be able to perform any useful calculation on them.
If that's what you want, it can be done easily but this is just using a complicated program (excel) as just a basic viewer for tabular data. You my as well write the table as a text file.
Ana Bermejo Jimenez
le 26 Juil 2019
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Spreadsheets dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!