xlswrite
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I am trying to write a cell array (1718x142 cell) back to xls. Neither xlswrite command nor a simple manual copy paste works. I think my problem is that the cell array itself is composed of individual single cell arrays of short strings or empty cell. I would like to have an advise how to convert to a single layer cell array that I can then copy to xls.
Thank you in advance
0 Kommentare
Akzeptierte Antwort
Titus Edelhofer
am 31 Mär. 2011
If the entries in your cell array are indeed 1x1 cells of strings or empty cells, try to convert each cell entry to a string: xConverted = cellfun(@char, xOriginal, 'Uniformoutput', false);
Titus
2 Kommentare
Michael Neal
am 17 Mai 2012
If I had a matrix that consisted of both strings and numbers, would I want to rewrite the numbers as strings to the matrix?
Image Analyst
am 17 Mai 2012
No, you can have both in one cell array, though you can do it that way if you want. The complication was that instead of the "string cells" in your cell array containing simple strings, they contained a cell array that contained a string. That's an extra layer of cells that you most likely don't need. Likewise, the "number cells" in your cell array should contain a number directly, not a cell that contains a number.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Characters and Strings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!