for
循环如下:
N = 2;T = 3;
Trials = rand(N,T);
for i=1:N
for j=1:T
AverageValue = mean2(Trials);
Trials(i,j) = Trials(i,j) - AverageValue;
end
end
困难在于AverageValue
根据每次更新来改变它的值Trials
。
============================================
将 'mean2' 替换为 'trapz' 的更新版本:
N=4;T=5;
Trials=rand(N,T);
for i=1:N
for j=1:T
IntValue=trapz(trapz(Trials(1:3,2:5)));
Trials(i,j)=Trials(i,j)+IntValue;
end
end
请帮忙,谢谢!