how to use "save" matlab
이전 댓글 표시
Hi all, i create a very big file in matlab and then i try to write it in a txt file using the fprintf() function. But after a while a message pops up saying that there is not enough memory or sth like that.. How can i save it in the txt file? Can i use the save function of matlab to do that?
thanks. Daniel
댓글 수: 12
How big is "very big"???
We need exact, complete error messages in context, not cute snippets of "or sth like that". Even with all the talents of forum denizens, the Mind Reading Toolbox isn't widely available.
Show the code snippet that tried to write the file and the resulting error cut 'n pasted from the command window without edits.
Why would you choose to save a large file as text, anyway? Surely you wouldn't expect/need a user to look at it manually that way?
Use save and save it as a .mat file instead.
Daniel Barzegar
2014년 6월 19일
José-Luis
2014년 6월 19일
That's really not very big. What commands are you using?
Daniel Barzegar
2014년 6월 19일
Daniel Barzegar
2014년 6월 19일
Daniel Barzegar
2014년 6월 19일
José-Luis
2014년 6월 19일
a = 1:3;
your_data = a(4)
You are probably trying to do something like that. You are trying to access something that does not exist.
Please try using the debugger and look at the offending variables. The error should become evident.
Image Analyst
2014년 6월 19일
Daniel, it's like pulling teeth. Where is your code or the FULL error message, or both? Why won't you let us help you by providing it?????????????????
Daniel Barzegar
2014년 6월 19일
Daniel Barzegar
2014년 6월 19일
dpb
2014년 6월 19일
The other files don't exist or are somewhere else, maybe? Hard to say from here, you'll have to poke around at the command line and see what's what...
채택된 답변
추가 답변 (1개)
your_data = rand(60000,16);
fid = fopen('data.txt','w');
fprintf(fid, [repmat('%f ',1,size(your_data,2)) '\n'], your_data)
fclose(fid)
About 8MB. Please provide feedback on the answers you get.
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!