This code gives me this mistake Error using eig For standard eigen problem EIG(A), A must be square.I hope anybody help me

2 visualizzazioni (ultimi 30 giorni)
T=0:5; F=@(n)3.^n.*cos(T); G=0; for m=0:5; G=G+[F(m-1) F(m+1) F(m+2);F(m+3) F(m+1) F(m+2);F(m) F(m+1) F(m+2)] end q=eig(G)
  1 Commento
Roger Stafford
Roger Stafford il 11 Apr 2018
Modificato: Roger Stafford il 11 Apr 2018
As you have defined G, it will be a singular matrix - that is, its determinant will be zero, because its rows are clearly not linearly independent. That will lead to a lot of trouble. So your problem is fundamental.
The error message is undoubtedly due to the fact that each F entry is a 1-by-6 array which makes G be 3-by-18 and therefore not square. That I think is easily corrected, but that is not the main problem. Singularity is what you need to worry about.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su MATLAB in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by