how to get an output from the command window into a text file?? plz answer ,its very necessary

i have a set of coordinates which i got after processing an image ,now i want to those coordinates in form a text file to apply them as an input to another application,,,..

 채택된 답변

sixwwwwww
sixwwwwww 2013년 10월 13일
편집: sixwwwwww 2013년 10월 13일
Dear Srinivas Sri, for example you have coordinates in the form of 'x' and 'y' array then you can write it in a text file using "dlmwrite" function like this:
x = 1:20;
y = 2:2:40;
M = [x' y'];
disp(M)
dlmwrite(filename, M, '\t')

댓글 수: 10

i have tried the same one you sent me , but its saying that its undefined function...
Have you changed the "filename"?
what file name should i write there..is it the text file i want the answer to be in .. or what ???
thank u very much...its working.. just out of curiosity - what if i want the matrix in a text file in matrix form itself.......
For matrix you can do the same. Just save all the values in a matrix (e.g. M) and then use:
dlmwrite('MyCoordinates.txt', M, '\t')
Also accept this answer to help others find solution of similar question. Good luck!
if we are doing like that ,they are coming in a same line ,not row and column wise....
If you will open your file in "Notepad" then you will not see the actual matrix form but if you will open your file in "WordPad" or "Microsoft Word" then you can see it in matrix form
thank u very much........... :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Standard File Formats에 대해 자세히 알아보기

태그

질문:

2013년 10월 13일

댓글:

2013년 10월 13일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by