I have a for loop and want to get a matrix called P as output. I want to get different values in P for each iteration and want to print it as P1, P2, P3…Pn. I tried the below code but, I got only Pn here. How can I modify this?
n=size(Image);for i=1:n for j=1:n a11=Ix(i,j)./sqrt(Ig(i,j).^2.*(1+mu.^2.*Ig(i,j).^2)); a12=-Iy(i,j)./Ig(i,j); a13=-mu.*Ix(i,j)./sqrt(1+mu.^2.*Ig(i,j).^2); a21=Iy(i,j)./sqrt(Ig(i,j).^2.*(1+mu.^2.*Ig(i,j).^2)); a22=Ix(i,j)./Ig(i,j); a23=-mu.*Iy(i,j)./sqrt(1+mu.^2.*Ig(i,j).^2); a31=mu.*Ig(i,j).^2./sqrt(Ig(i,j).^2.*(1+mu.^2.*Ig(i,j).^2)); a32=0; a33=1./sqrt(1+mu.^2.*Ig(i,j).^2); end P=[a11 a12 a13; a21 a22 a23; a31 a32 a33];end
Best Answer