For standard eigenproblem EIG(A), A must be square
5 views (last 30 days)
Show older comments
for the following code I get an error "For standard eigenproblem EIG(A), A must be square", what can be the reason?
Shh = imread('SLC_HH.tif'); Shv = imread('SLC_HV.tif'); Svh = imread('SLC_VH.tif'); Svv = imread('SLC_VV.tif'); S = [Shh,Shv;Svh,Svv];
A= -9999*ones(11660,6033); for i= 1:1000 for j= 1:600
%Coherency matrix T11 = (abs(Shh+Svv)).^2; T12 = (Shh+Svv).* conj(Shh-Svv); T13 = (Shh+Svv).* conj(Shv); T21 = (Shh-Svv).* conj(Shh+Svv); T22 = (abs(Shh-Svv)).^2; T23 = (Shh-Svv).* conj(Shv); T31 = 2*Shv.*conj(Shh+Svv); T32 = 2*Shv.*conj(Shh-Svv); T33 = (abs(Shv)).^2; T = 0.5 * [T11, T12, T13; T21, T22, T23; T31, T32, T33];
%Eigen value decomposition [V,D] = eig(T) ;
0 Comments
Answers (3)
Youssef Khmou
on 2 Sep 2014
For a non square matrix, you need either to compute the covariance T*T' or you can adjust the dimensions , try the following procedure :
M=size(T);
n=min(M);
TT=T(1:n,1:n);
[V,D]=eig(TT);
0 Comments
Julia
on 2 Sep 2014
Hi,
Are your images greyscale or truecolor images?
From the Matlab help:
A = imread(filename, fmt)
If the file contains a grayscale image, A is an M-by-N array. If the file contains a truecolor image, A is an M-by-N-by-3 array. For TIFF files containing color images that use the CMYK color space, A is an M-by-N-by-4 array.
Perhaps your matrices Shh, Shv, Svh and Sw are not 2-dimensional and this causes the error for T?
Hana
on 2 Sep 2014
1 Comment
Pierre Benoit
on 2 Sep 2014
Please comment instead of answering if it's not actually an answer.
It appears that your matrice T is not square, have you checked the dimensions of your images and your variables Tij ?
See Also
Categories
Find more on Computer Vision with Simulink in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!