조회 수: 1(최근 30일)
Trung Ngo 2 Jul 2019
Commented: Trung Ngo 3 Jul 2019
Hi all,
I am currently having a 256GB SSD with a Sequential Read of 2.5GB/s, but loading a 60MB matrix took an average of 100.3 seconds to run. Is it possible if you can check my matrix -v7.3 to suggest me a method to speed up this loading process.
Should I convert it to -v6.0?

#### 댓글 수: 2

Akbar 2 Jul 2019
What is "v7.3"? A Matlab version or what?
Trung Ngo 2 Jul 2019
Sorry for being unclear, it is the version 7.3 of MAT-File versionhttps://www.mathworks.com/help/matlab/import_export/mat-file-versions.html

로그인 to comment.

### 채택된 답변

per isakson 2 Jul 2019
per isakson 님이 편집함. 2 Jul 2019
Elapsed time is 25.627453 seconds.
The variable is_land is 10GB (60MB is with compression)
>> S
S =
struct with fields:
is_land: [36023×36023 double]
x: [1×36023 double]
y: [1×36023 double]
>>
>> 36023^2*8/1e9
ans =
10.381
Only -v7.3 can handle a 10GB matrix.
However, is_land holds only zeros and ones. You may convert it to uint8 and save a factor eight. uint8 in combination with -v7.0 (or -v6.0) will be much faster.

#### 댓글 수: 3

Trung Ngo 2 Jul 2019
I look further and it only took 30 seconds on my computer. The interpolation method is consuming the 70 seconds rest.
clearvars;
tic
lon =(-140--170).*rand(3,1)-170;
lat =(50-40).*rand(3,1)+40;
tf=zeros(1,length(lon));
for i=1:length(lon)
tf(1,i) = interp2(x,y,is_land,lon(i),lat(i),'cubic');
end
wtime = toc;
fprintf ( 1, 'Program took %f seconds to run.\n', wtime );
Is it possible if you can also suggest me a faster interpolation method.
per isakson 2 Jul 2019
No, my guess is that interp2 is reasonable fast.
Trung Ngo 3 Jul 2019
Thanks for your help, I will try to convert it to uint8

로그인 to comment.