Rounding of a number/ text file format
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
missC
el 23 de Jul. de 2014
Comentada: missC
el 24 de Jul. de 2014
Hi, i used this command to save a work space variable into text file.
save('corner.txt', 'new_bpCols', '-ASCII', '-double','-append');
and the output is like I attached, I wanted to have the exact values as in the variables which is:
What format I should use?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/166041/image.jpeg)
The workspace variable value: 19 20 38 46 64 66 101 105 122 129 148 149
Thank you
0 comentarios
Respuesta aceptada
Mischa Kim
el 23 de Jul. de 2014
Editada: Mischa Kim
el 23 de Jul. de 2014
missC, you could use instead
x = 1:5;
fid = fopen('corner.txt','w');
fprintf(fid,' %d\n',x); % > %d: write integer values to text file
fclose(fid)
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Cell Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!