Save matlab output in textfile
조회 수: 8 (최근 30일)
이전 댓글 표시
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
채택된 답변
Azzi Abdelmalek
2013년 8월 23일
편집: Azzi Abdelmalek
2013년 8월 23일
x=[1;2;3];
y=[10;20;30];
v=[x y]
dlmwrite('yourfile.txt',v,'delimiter',' ')
%or
dlmwrite('yourfile.txt',v,'delimiter','\t')
댓글 수: 0
추가 답변 (2개)
ES
2013년 8월 23일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!