フィルターのクリア

How to find Eigen Values without using eig() function ???

18 ビュー (過去 30 日間)
Saad
Saad 2014 年 4 月 18 日
回答済み: KAJING TAYENG 2020 年 11 月 4 日
Hello
I want to calculate Eigen Values without using eig() function. I am actually generating a HDL code of this code, but when i use eig() function, I get an error of not supported function.
Please help me with this
  3 件のコメント
Mischa Kim
Mischa Kim 2014 年 4 月 18 日
John, just out of curiosity, what exactly is wrong with Saad trying to write his/her own algorithm if he/she wishes or decided to take this path?
John D'Errico
John D'Errico 2014 年 4 月 29 日
編集済み: John D'Errico 2014 年 4 月 29 日
If Saad lacks understanding about the basic eigenvalue algorithms that he needs to ask questions like this, then wanting to write eig from scratch is silly. There is a huge difference between professionally written code and whatever mess Saad could cobble together, so that his NEXT question would probably be, "Why does my eigenvalue code fail in this crazy way?" And that question will re-appear every time Saad would trip over some new (to him) problematic case.
Sorry but resolve the problem, don't replace high quality code with amateur code. If you do re-write eig, expect amateur results.

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

回答 (2 件)

Walter Roberson
Walter Roberson 2014 年 4 月 29 日
Saad, to generate HDL you would have to convert your algorithm to use the Fixed Point Toolbox. Have you tried that? HDL Coder would refuse to generate for floating point.

KAJING TAYENG
KAJING TAYENG 2020 年 11 月 4 日
function [eigVal,eigVec]=spec_calculation(A)
s = size(A);
if s(1)~=s(2)
error('Error: Input must be square.')
end
I = eye(length(A));
%
syms x
eq1 = det(A-I*x) == 0 ;
eigVal = double(solve(eq1,x));
%
eigVec = zeros(s);
for i = 1:length(A)
syms y
eq2 = (A-eigVal(i)*I)*y == 0;
eigVec(:,i) = double(solve(eq2,y));
end
end

Community Treasure Hunt

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

Start Hunting!

Translated by