xlswrite

3 ビュー (過去 30 日間)
New
New 2011 年 3 月 31 日
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

採用された回答

Titus Edelhofer
Titus Edelhofer 2011 年 3 月 31 日
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 件のコメント
Michael Neal
Michael Neal 2012 年 5 月 17 日
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 2012 年 5 月 17 日
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.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by