Write in the different csv cells in matlab

조회 수: 3 (최근 30일)
Kris zenitis
Kris zenitis 2014년 7월 21일
답변: Shashank Prasanna 2014년 7월 21일
I am trying to write a cell array into a csv file. Array is of size Nx5. I am using the following code:
fid = fopen('file.csv','w');
for i=1:size(data_names,1)
fprintf(fid, '%s %s %s %s %s', data_names{i,1:5});
fprintf(fid,'\n');
end
fclose(fid);
The problem is the it does write only in the first column of csv so I ve got the first 5 elements of the first row in an one column vector of size 5. How is it possible to write in the different column cell in csv???

답변 (1개)

Shashank Prasanna
Shashank Prasanna 2014년 7월 21일

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by