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

3 ビュー (過去 30 日間)
Hana
Hana 2014 年 9 月 2 日
回答済み: Youssef Khmou 2014 年 9 月 2 日
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) ;

回答 (3 件)

Youssef  Khmou
Youssef Khmou 2014 年 9 月 2 日
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 2014 年 9 月 2 日
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?
  1 件のコメント
Hana
Hana 2014 年 9 月 2 日
My images are grayscale.

サインインしてコメントする。


Hana
Hana 2014 年 9 月 2 日
what is the solution then?
  1 件のコメント
Pierre Benoit
Pierre Benoit 2014 年 9 月 2 日
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 ?

サインインしてコメントする。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by