I have a large variable that I want to export out of Matlab;
Name Size Bytes Class
NewDataSet2 756071x9 1167474054 cell
When I try to export it using:
writecell(NewDataSet2,'myDataFile.csv')
I get this error:
Error using writecell (line 117)
Nested cell arrays are not supported.
Any ideas on how to get this variable out of matlab and into a file (such as a text or excel file)?

답변 (1개)

Jan
Jan 2019년 5월 3일

0 개 추천

It depends on what the contents of the cell elements is. Posting just the size does not allow to know this. Perhaps all you need is:
data = cell2mat(NewDataSet2)

댓글 수: 3

Jessica Yorzinski
Jessica Yorzinski 2019년 5월 3일
Unforuntately, that does not work:
Error using cell2mat (line 45)
All contents of the input cell array must be of the same data type.
Jessica Yorzinski
Jessica Yorzinski 2019년 5월 3일
How can I determine the contents of each cell?
Jan
Jan 2019년 5월 4일
편집: Jan 2019년 5월 4일
@Jessica: Are you sure that you have to store such a large set of data in a cell array? This is rather inefficient. Please post a small example of the data. Then suggesting a solution is not based on pure guessing only.
If "determine the contents" means to get the class of the data:
cellfun('isclass', C, 'double')
cellfun(@class, C, 'UniformOutput', false)

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Text Data Preparation에 대해 자세히 알아보기

제품

태그

질문:

2019년 5월 3일

편집:

Jan
2019년 5월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by