For standard eigenproblem EIG(A), A must be square

3 visualizaciones (últimos 30 días)
Hana
Hana el 2 de Sept. de 2014
Respondida: Youssef Khmou el 2 de Sept. de 2014
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) ;

Respuestas (3)

Youssef  Khmou
Youssef Khmou el 2 de Sept. de 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);

Julia
Julia el 2 de Sept. de 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
Hana el 2 de Sept. de 2014
what is the solution then?
  1 comentario
Pierre Benoit
Pierre Benoit el 2 de Sept. de 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 ?

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by