how to plot eigenvector calculated from eigs from the matrices created by freefem++
6 次查看(过去 30 天)
显示 更早的评论
How to plot the eigenvector calculated from eigs from the matrices created by freefem++?
0 个评论
回答(1 个)
William Rose
2024-2-12
quiver() is good for 2-D vectors; quiver3() for 3D.
For an example, I will use the magic square matrix, but I could use some opther random 2x2 matrix.
[v,d]=eigs(magic(2))
Plot the eigenvectors, with their bases at the origin:
quiver([0,0],[0,0],v(1,:),v(2,:));
axis equal; grid on
I use 'axis equal' to get a plot with equal scale factors on the x and y axes. If you don't do this, then vectors that are at right angles may look like they're not, etc.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Vector Fields 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!