フィルターのクリア

Unique solution / Prevent certain solution

1 回表示 (過去 30 日間)
J S
J S 2018 年 8 月 31 日
編集済み: J S 2018 年 8 月 31 日
How do I suppress the solution of the zero vector in the linear solver to achieve a unique solution as [1;1] for example?
function [ e ] = eigenvector( A )
A=[2 -1;-1 2]; % Matrix A
syms lam; % symb Variable lamda
%Return
lam=solve(charpoly(A,lam),lam);
for i=1:length(lam)
EV(i,:)=double(linsolve((A-lam(i)*eye(length(lam))),[0;0]));
disp([num2str(i),'. EV: ',num2str(EV(i))])
end
end

回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!