xlswrite

조회 수: 4 (최근 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 CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by