# how to plot eigenvector calculated from eigs from the matrices created by freefem++

7 Ansichten (letzte 30 Tage)
AMIT am 12 Feb. 2024
Beantwortet: William Rose am 12 Feb. 2024
How to plot the eigenvector calculated from eigs from the matrices created by freefem++?
##### 0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Antworten (1)

William Rose am 12 Feb. 2024
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))
v = 2×2
-0.6000 -0.7071 -0.8000 0.7071
d = 2×2
5 0 0 -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 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu Vector Fields finden Sie in Help Center und File Exchange

R2023b

### Community Treasure Hunt

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

Start Hunting!

Translated by