Reputation: 95
I have got a cell array Ystg of size 219*1 and i want to write it into a text file .
i tried this code but doesn't work
C = Ystg.';
fid = fopen('file.dlm', 'wt');
fprintf(fid, '"%s"\t"%s"\t"%d"\t"%s"\t\n', C{:});
fclose(fid);`
Upvotes: 1
Views: 54
Reputation: 1213
this should work for you :
C = Ystg;
fid = fopen('file.dlm', 'wt');
for i=1:219
fprintf(fid, '"%s"\t"%s"\t"%d"\t"%s"\t\n', C{i}{:});
end
fclose(fid);
Upvotes: 1