2
您好我有一個4x4雙矩陣A如何使矩陣1 + J,1-J,-1 + J,-1-J在MATLAB
1+2i 2-1i -3-2i -1+4i
3-1i -3+2i 1-3i -1-3i
4+3i 3+5i 1-2i -1-4i
4+2i -5-2i 2+3i 2-1i
這是我的MATLAB代碼:
for n=1:1:4
for k=1:1:4
temp=A(n,k);
rea=real(temp);
img=imag(temp);
Distance1(n,k)=sqrt(((rea-1).^2)+((img-1).^2));
Distance2(n,k)=sqrt(((rea+1).^2)+((img-1).^2));
Distance3(n,k)=sqrt(((rea+1).^2)+((img+1).^2));
Distance4(n,k)=sqrt(((rea-1).^2)+((img+1).^2));
Distance(n,k)=min([Distance1(n,k); Distance2(n,k); Distance3(n,k); Distance4(n,k)]);
Decision(n,k)=?
end
end
如何製作一個決策矩陣應該是1 + j,1-j,-1 + j,-1-j就像下面這個例子矩陣一樣?
1+i 1-i -1-i -1+i
1-i -1+i 1-i -1-i
1+i 1+i 1-i -1-i
1+i -1-i 1+i 1-i