Filter löschen
Filter löschen

xlswrite

3 Ansichten (letzte 30 Tage)
New
New am 31 Mär. 2011
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

Akzeptierte Antwort

Titus Edelhofer
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
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
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Cell Arrays 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!

Translated by