필터 지우기
필터 지우기

How to print out cell array to CSV file?

조회 수: 2 (최근 30일)
TingTing
TingTing 2014년 3월 1일
댓글: the cyclist 2014년 3월 3일
Hi,
I have a large cell array (600000*75). I just want to write it into CSV file. It has both numeric and text values. How shall do it?

채택된 답변

the cyclist
the cyclist 2014년 3월 1일
My favorite way to do this is the cellwrite() function (from the File Exchange).
  댓글 수: 2
TingTing
TingTing 2014년 3월 3일
Hi, thank you, but because some of my text strings have comma in it, it didn't work quite well with cellwrite...
the cyclist
the cyclist 2014년 3월 3일
Did cellwrite crash or give an error? Or is it just that the output was not what you expect? If your output has commas, then even if cellwrite (or any other MATLAB function) does its job, then the program you use to open the output might format it badly because it assumes those commas are field separators.
One trick I use sometimes is to replace commas in the cell array with semicolons. You can use the regexprep() function to do that. (Obviously, that's not a good solution if you really need those commas.)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by