how to write this data in text file?
Mostrar comentarios más antiguos
Hi,
how can i store my data in .txt as it is shown in workspace that is in separate column..

where variable name is sets(9:i) now this i is 5 in this case but it could be other wise
for i=1:5
fprintf(fid, '%.2f\n',sets(9,i) );
end
not working..its writing all (9*5) data in a single column...
Respuesta aceptada
Más respuestas (2)
Roger Wohlwend
el 30 de Jul. de 2014
Use the function csvwrite:
csvwrite(filename,Matrix)
Or consider saving the matrix in a mat-file using the command save.
Azzi Abdelmalek
el 30 de Jul. de 2014
dlmwrite('your_file.txt',M) % M is your matrix
Categorías
Más información sobre Spreadsheets en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!