如何指定保存在-v7.3 matfile中的大数组的块大小?

问题描述 投票:0回答:1

我正在将大型数据数组保存到mat文件。

m = matfile('data.mat','writable',true);
m.X(1000,1000,10,50000) = nan(1,'single');
for ii = 1 : 50000
  % do some computation
  m.X(1:1000,1:1000,1:10,ii) = Y;
end

如何将X的块大小设置为[1000,1000,1,1]?

matlab hdf5 mat-file
1个回答
0
投票

您无法使用matfile命令,但您使用的是HDF5 API。由于matfiles v7.3 use the HDF5 format,我想它也应该在阅读方面对您有用?这是文档中的一个小示例:

h5create('myfile.h5','/DS3',[20 Inf],'ChunkSize',[5 5]);
for j = 1:10
      data = j*ones(20,1);
      start = [1 j];
      count = [20 1];
      h5write('myfile.h5','/DS3',data,start,count);
end
h5disp('myfile.h5');

Source of the example

© www.soinside.com 2019 - 2024. All rights reserved.