How to convert a cell vector with numbers and non-numbers into a comma-seprated (.csv) format?
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi,
I have the cell array:
Matrix(1,1) = {'ABCD'}
Matrix(1,2) = {'*'}
Matrix(2,1) = {'251'}
Matrix(2,2) = {'0'}
Matrix(3,1) = {'*'}
Matrix(3,2) = {'01/12/2001'}
I need to export a csv (I guess using csvwrite function) with this format:
ABCD,*
251,0
*,01/12/2001
Someone can help me? Many thanks!
댓글 수: 0
채택된 답변
Julia Antoniou
2018년 1월 26일
Hi Adriano,
You could accomplish this with the following commands:
T = cell2table(Matrix);
writetable(T,'filename.csv','WriteVariableNames',false);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!