フィルターのクリア

Store an indexed matrix to later recall

3 ビュー (過去 30 日間)
AR
AR 2015 年 12 月 4 日
編集済み: Walter Roberson 2015 年 12 月 4 日
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

採用された回答

Walter Roberson
Walter Roberson 2015 年 12 月 4 日
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 件のコメント
AR
AR 2015 年 12 月 4 日
Walter, Could I use this 3D Array, X={[64x3] [64x3] [64x3] [64x3] etc}, in fprintf somehow to save in a txt file? Thx, Allen
Walter Roberson
Walter Roberson 2015 年 12 月 4 日
編集済み: Walter Roberson 2015 年 12 月 4 日
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 .'

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by