b=[1,0;0,1;1,0;0,1;-1,1;-1,0];
l=[0,0,4,-197,-193,2]';
p=[0.91,0,0,0,0,0;0,0.59,0,0,0,0;0,0,0.43,0,0,0;0,0,0,0.37,0,0;0,0,0,0,0.42,0;0,0,0,0,0,0.25];
for i=1:10
x=inv(b'*p*b)*b'*p*l;
v=b*x-l
x=v'*p*v/4;
w=diag(1./abs(v))
p=w*p;
end
此程序能运行,可是我所求的每次迭代算出来的w都是乘以一开始的p=[0.91,0,0,0,0,0;0,0.59,0,0,0,0;0,0,0.43,0,0,0;0,0,0,0.37,0,0;0,0,0,0,0.42,0;0,0,0,0,0,0.25];而不是乘以迭代算出来的新的矩阵p 该如何修改 谢谢