Get the unique solution to a simultaneous equation
显示 更早的评论
I wish to find the eigenvalues and vectors of a matrix without the big function
clc
clear all
close all
syms lamda x1 x2
A = input('Enter the matrix: ');
n = size(A);
if n(1) == n(2)
disp(['Characterisitc equation = ',char(det(A-lamda*eye(size(A)))),' = 0']);
disp('Eigen Values: ');
eigen_values = solve(det(A-lamda*eye(size(A))),lamda);
for i =1:size(A)
disp(['Vector ',num2str(i)]);
mat = eigen_values(i).*eye(size(A));
X = linsolve(A-mat,zeros(n(1),1))
end
else
disp('The matrix dimensions do not match');
end
I am able to find the Eigen values but the Eigen vector comes out [0;0]. How do I set a condition to obtain unique/distinct values.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!