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 次查看(过去 30 天)
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 个评论
Roger Stafford
Roger Stafford 2018-4-11
编辑:Roger Stafford 2018-4-11
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by