hello, filename =strcat('directory',int2str(v),'.txt'); save ( filename,'im') can I know why I used this script, the .txt file cannot be read.fyi, I used loop and put the script inside the loop. Actually the .txt file should read a number. Can someone correct my coding.Thanks!-_-

댓글 수: 5

Tulips
Tulips 2012년 7월 6일
can someone advice how to save as a text(.txt) becoz the above coding cannot read the value .txt file..however, it can save as .txt ...thanks
Thomas
Thomas 2012년 7월 6일
can you post your whole code.. this question is very ambiguous and confusing..
Tulips
Tulips 2012년 7월 6일
편집: Walter Roberson 2012년 7월 6일
for v=1:100
im=subImage;
filename =strcat('directory',int2str(v),'.txt');
save ( filename,'im')
end
guys, it can save .txt file but when I opened it cannot be read..why is that?
wasif saeed
wasif saeed 2017년 5월 8일
can you please guide me that i have a problem when i open SEGY data in matlab and i tried to save in txt file than it gives an error ..please guide what should i do ??
Walter Roberson
Walter Roberson 2017년 5월 8일
wasif saeed, please start a new Question for this.

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

 채택된 답변

Walter Roberson
Walter Roberson 2012년 7월 6일

2 개 추천

When you want to save as a text file, use the save() -ascii flag
save ( filename,'im', '-ascii')

댓글 수: 2

Tulips
Tulips 2012년 7월 6일
it can save as a text file ..however, the file is empty..no pixels value inside.why is that?pls advice
Tulips
Tulips 2012년 7월 6일
it can save as a text file ..however, the file is empty..no pixels value inside.why is that?pls advice
warning at the command window shown Warning: Attempt to write an unsupported data type to an ASCII file. Variable 'im' not written to file.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Low-Level File I/O에 대해 자세히 알아보기

태그

질문:

2012년 7월 5일

댓글:

2017년 5월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by