symbolic eig, problems with presentation and zero values

1 次查看(过去 30 天)
Please look at the following example
if true
clear all
A= sym([1 1 1; 1 1 1; 1 1 1])
% the eigenvalues of that matrix are l1=0 (alg mult=2) l2=3 (alg mult=1)
% the following matrix contains eigen vectors (not the same base as matlab uses)
V2=[-1 -1 1;2 -1 1; -1 2 1]
% Check
Z=A*V2(:,1) % OK
Z=A*V2(:,2) % OK
Z=A*V2(:,3) % OK
B=inv(V2)*A*V2
z=B(1,3)
ps2=vpa(z,3)
so the value of B(1,3) should be zero, but since I have chosen symbolic variables matlab returns
z=-18014398509481983/649037107316853453566312041152512
z=-2.78e-17
that is a bit annoying, how can it be avoided?
Uwe Brauer

回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by