how to write and read file quickly?
1 view (last 30 days)
Show older comments
I have one data translation device of which I am getting data using 'getdata' function. now I have to save this data and once it saved I have to read it again and plot a graph.
I am getting data using following code
[d,t]=getdata(ai); // where d is data and t is time
data1=d(:,1);
data2=d(:,2);
I have to save this data very quickly and again read it and plot graph.
which method shall I use?? xslread and write or csvread and write or dlmread and write?
0 Comments
Answers (1)
Walter Roberson
on 8 Mar 2016
fwrite() the data to the file, and fread() it from the file.
Separately from that, when you are dealing with the file I/O in MATLAB, you might be able to use memmapfile(). An example of using that to communicate between sessions is http://www.mathworks.com/help/matlab/import_export/share-memory-between-applications.html
If you have two different MATLAB sessions that are using a file to communicate, you should consider instead using a shared memory segment; see http://www.mathworks.com/matlabcentral/fileexchange/28572-sharedmatrix
0 Comments
See Also
Categories
Find more on Spreadsheets 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!