matlab code problem

clear;
X=[1 2 3 4; 5 6 7 8 ;9 10 11 12];
N=[1 2 3 4; 5 6 7 8 ;9 10 11 12];
N=kron(N,ones(size(X,1),1));
w =[1 1 1 1;1 1 1 1;1 1 1 1];
for i=1:3
for j=1:4
b(i,j)=sqrt(w(i,j)*(N(i,j)-X(i,j))^2);
end
end
c=sum(b,2)
[val ind]=min(c)
result

val =

0
ind =

1
The first time N=[1 2 3 4],second time N=[5 6 7 8],third time N=[9 10 11 12].My result just show one .I want auto show three answers.Not manual change N.Please help.Thanks!!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories