write cell output to a joint txt file
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, I have an output and want to write all cells into the same file so that each cell that is of different size will be next to each other in the final file. I am trying to use fprintf.
% Result is 1x13 cell where each cell is different size of double type
% Result(1)=[139x2 double]
% Result(2)=[54x2 double] etc;
Res=cell2table(Result);
max_num_col = 26;
fileID = fopen('Result.txt','w');
format = repmat('%f',1,max_num_col);
fprintf(fileID,format,Res);
fclose(fileID);
Thanks!
Risposte (1)
Guillaume
il 12 Lug 2018
Well, assuming that the conversion to table has been successful, simply:
writetable(Res, 'Result.txt');
should do it. If not, giving us an actual example of the data would help.
2 Commenti
Vedere anche
Categorie
Scopri di più su Material Sciences in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!