Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plotting vector in 3D in Matlab

I'm studying Linear Algebra. I would like to visualize a vector [2, 1, 2] in 3D. I used the following command:

quiver3(0,0,0,2,1,2)

And either my understanding of Linear Algebra is off or I'm doing something wrong with MATLAB. But what the plot looks like to me is that it's plotting vector [1.8, 0.9, 1.8].

like image 869
Mike Glaz Avatar asked Jul 24 '26 09:07

Mike Glaz


1 Answers

By default, quiver3 will use whatever scaling that optimizes the display of the vectors.

quiver3(...,scale) automatically scales the vectors to prevent them from overlapping, and then multiplies them by scale. scale = 2 doubles their relative length, and scale = 0.5 halves them. Use scale = 0 to plot the vectors without the automatic scaling.

You'll want to specify the scale parameter as 0 to prevent this automatic scaling and to accurately represent the data that you provide

quiver3(0, 0, 0, 2, 1, 2, 0);

enter image description here

like image 160
Suever Avatar answered Jul 28 '26 04:07

Suever



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!