我尽我所能不使用循环。但是我发现除了使用循环之外很难解决它。是否可以矢量化循环代码?谢谢
a=[0.1361,0.8530,0.0760;0.8693,0.6221,0.2399;0.5797,0.3510,0.1233;.5499,0.5132,0.1839; 0.1450,0.4018,0.2400];
b=[0.4173,0.4893,0.7803;0.0497,0.3377,0.3897;0.9027,0.9001,0.2417;0.9448,0.3692,0.4039;0.4909,0.1112,0.0965];
[m1,n1,l]=size(a);
awe=-0.5;
g = [81.2379 92.4675;92.4675 118.1451];
ver=inv(g);
p=zeros(m1,n1);
for i=1:m1
for j=1:n1
CD=[a(i,j) ; b(i,j)]
p(i,j)= CD'*ver* CD;
end
end
q = exp(awe*p);