MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayMATLAB Central > MATLAB Newsreader > efficiently fwrite a cellarray of matrices 

Subject: efficiently fwrite a cellarray of matrices From: David Date: 21 Jan, 2013 15:54:08 Message: 1 of 9 
Hi everyone, 
Subject: efficiently fwrite a cellarray of matrices From: Bruno Luong Date: 21 Jan, 2013 20:46:08 Message: 2 of 9 
I think the mex file is a way to go. 
Subject: efficiently fwrite a cellarray of matrices From: Jan Simon Date: 21 Jan, 2013 21:20:08 Message: 3 of 9 
Hi David, 
Subject: efficiently fwrite a cellarray of matrices From: David Date: 22 Jan, 2013 10:31:08 Message: 4 of 9 
Hi Jan and Bruno, hi everyone, 
Subject: efficiently fwrite a cellarray of matrices From: Bruno Luong Date: 22 Jan, 2013 11:02:08 Message: 5 of 9 
If you don't want mex, here is what I propose: 
Subject: efficiently fwrite a cellarray of matrices From: David Date: 22 Jan, 2013 21:57:10 Message: 6 of 9 
Bruno, Thank You very much for your implementation! It is indeed the most efficient way (so far) for mediumsized matrices contained in the cell C: 
Subject: efficiently fwrite a cellarray of matrices From: David Date: 22 Jan, 2013 22:12:10 Message: 7 of 9 
Oh, to be more correct, I should add this: The thresholds 50 and 5000 are just a rough rule of thumb, which I gained from testing with matrices of similar sizes (e.g. only between 6x6 and 8x8). The reason why I did it this way is that it better fit to my application. 
Subject: efficiently fwrite a cellarray of matrices From: Jan Simon Date: 30 Jan, 2013 10:57:08 Message: 8 of 9 
Dear David, 
Subject: efficiently fwrite a cellarray of matrices From: Yair Altman Date: 18 Apr, 2013 17:11:10 Message: 9 of 9 
I would also test save('myFile.mat','C','v6')  on my system it's faster than the naive for loop, almost as fast as your RLE solution, and much simpler and easier to develop, debug and maintain. 
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.