Save matlab output in textfile
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Simon Becker
el 23 de Ag. de 2013
Respondida: Nabin Bera
el 1 de Jun. de 2016
I have two vectors in matlab with n-entries, let us call them x and y.
Now I want to create a textfile that has the following structure: You have two columns(one for the x values and one for the y-values) and then I want to get:
x(1) y(1)
x(2) y(2)
x(3) y(3)
and so on.
does anybody here know how this can be done?
0 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 23 de Ag. de 2013
Editada: Azzi Abdelmalek
el 23 de Ag. de 2013
x=[1;2;3];
y=[10;20;30];
v=[x y]
dlmwrite('yourfile.txt',v,'delimiter',' ')
%or
dlmwrite('yourfile.txt',v,'delimiter','\t')
0 comentarios
Más respuestas (2)
ES
el 23 de Ag. de 2013
Easier way is to use diary function.
diary on
Print everything on the command window using disp, and let diary take care of it.
and then switch off diary.
0 comentarios
Nabin Bera
el 1 de Jun. de 2016
i cant write my output data into a .txt file in matlab 2015a.
0 comentarios
Ver también
Categorías
Más información sobre Environment and Settings 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!