我正在尝试进行一些计算,我想使用 parfor 或通过打开 matlabpool.. 并行执行它,因为当前的实现太慢了:
result=zeros(25,16000);
for i = 1:length(vector1) % length is 25
for j = 1:length(vector2) % length is 16000
temp1 = vector1(i);
temp2 = vector2(j);
t1 = load(matfiles1(temp1).name) %load image1 from matfile1
t2 = load(matfiles2(temp2).name) % load image2 from matfile2
result(i,j)=t1.*t2
end
end
它工作正常,但我真的很想知道是否有办法加快速度......提前非常感谢!