Reading writing matrices in matlab
1 view (last 30 days)
Show older comments
I have a 160000 x4 matrix generated on matlab. To write it onto a .txt file using dlmwrite takes forever, maybe around 8-12 hours. Is there any function which does this writing efficiently? I can save it however as .mat file, but can matlab .mat files be referred to in C/C++ codes and can we use the efficient writing techniques from there?
0 Comments
Answers (1)
Image Analyst
on 22 Apr 2014
Why can't you just write it out in binary with fwrite()?
4 Comments
Ken Atwell
on 22 Apr 2014
Well, not random. This is binary output suitable for reading in C with fread. The size of the file should be exactly 160000x4x8 bytes in size.
See Also
Categories
Find more on Text Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!