我使用此代码基本上将大约800个.TIF文件读入多维数组。每个tif文件是3500x7500。
%Automate the precip ingestion process
precipFile = which('PRECIPRATE.20110615.000000.tif'); %Location details of the files using example data
precipFileList = dir([fileparts(precipFile) filesep '*.tif']); %List of all precip files
precipFileNames = {precipFileList.name}'; %Names of all precip files
%Create a multidimensional array to store the precipitation
precip = zeros(3500,7000,length(precipFileNames)); %Pre-allocating an array
for k = 1:length(precipFileNames)
precip(:,:,k) = imread(precipFileNames{k}); %Read all precip file
end
但是这给了我
"Out of memory. Type HELP MEMORY for your options."
如果我尝试了十几个文件,代码就可以正常工作。
那么,我该如何解决这个问题呢?我最终可能不得不处理2000-3000个文件。