Store an indexed matrix to later recall
    2 views (last 30 days)
  
       Show older comments
    
Hello. I have a vector (1,12100) of indexed matrices [64 3] which I would like to recall specific indexed sets. All values are numbers. Tried dlmwrite but it causes my PC freeze and tried variations of fprintf like below but get errors.
fprintf(fileID,'%.6f\t\r\n',{X});
Any ideas on how best to file these sets for later recall? I would like to recall a [64 3] set via its indexed number which is from 1 to 12,100.
Thank you. --Allen
0 Comments
Accepted Answer
  Walter Roberson
      
      
 on 4 Dec 2015
        You can save() them as a cell array. If you really need to be able to restore individual members without reading the rest, then you can use matFile() with a cell array
You should also consider saving as a 3 dimensional array, 64 x 3 x 12100
2 Comments
  Walter Roberson
      
      
 on 4 Dec 2015
				
      Edited: Walter Roberson
      
      
 on 4 Dec 2015
  
			Yes; what format would you want? Is there to be three columns on each line? Is there to be some kind of marker between indices?
If it can just be (64*12100) rows of 3 columns then assuming you are starting with a cell array
temp1 = YourCell(:);
temp2 = vertcat(temp1{:});
fprintf(fid, '%.6f\t%6f\t%.6f\r\n', temp2.' );   %note .'
If you are starting with a 64 x 3 x 12100 array then
temp2 = permute(YourArray, [2 1 3]);
fprintf(fid, '%.6f\t%6f\t%.6f\r\n', temp2 );   %no .'
More Answers (0)
See Also
Categories
				Find more on Cell Arrays 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!