Partially loading matirx with matfile doesn't work
古いコメントを表示
I was trying to use matfile to partially load a big matrix storing in a v7.3 .MAT file. I had specified the colum Index but I don't think partially loading work for my case. I test the speed and matfile is just equally slow as load. However, when i tried to load along the row direction, matfile does work much and much faster than load.
Here is my question. Does partially loading function of matfile only work for row direction loading? I think it could be reasonable considering the row oriented memory storage strategy of MATLAB. But i really need confirm this. FYI, I also attached my test codes.
% ----- loading along columns
% matfile shows just equally speed as load
uxtMatrix = zeros(5000,50);
tic
for i = 1:50
Mat = matfile(matFilesv7_3{i});
uxtMatrix(i,:) = Mat.matrix(:,100);
end
toc
%
tic
uxtMatrix2 = zeros(5000,50);
for i = 1:50
load(matFilesv7_3{i},'matrix');
uxtMatrix2(i,:) = uxt(:,100);
end
toc
% ----- loading along rows
% matfile is much much faster! it works here
uxtMatrix = zeros(50,10000);
tic
for i = 1:50
Mat = matfile(matFilesv7_3{i});
uxtMatrix(i,:) = Mat.matrix(20,:);
end
toc
%
tic
uxtMatrix2 = zeros(50,10000);
for i = 1:50
load(matFilesv7_3{i},'matrix');
uxtMatrix2(i,:) = uxt(20,:);
end
toc
回答 (1 件)
Feng Cheng
2021 年 12 月 15 日
編集済み: Feng Cheng
2021 年 12 月 15 日
1 件のコメント
Feng Cheng
2021 年 12 月 15 日
編集済み: Feng Cheng
2021 年 12 月 15 日
カテゴリ
ヘルプ センター および File Exchange で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!