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!