简体   繁体   English

在 Matlab 中以 3D 形式绘制矢量

[英]Plotting vector in 3D in Matlab

I'm studying Linear Algebra.我正在学习线性代数。 I would like to visualize a vector [2, 1, 2] in 3D.我想在 3D 中可视化向量[2, 1, 2] 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.要么我对线性代数的理解不正确,要么我在 MATLAB 上做错了。 But what the plot looks like to me is that it's plotting vector [1.8, 0.9, 1.8] .但在我看来,情节是绘制向量[1.8, 0.9, 1.8]

By default, quiver3 will use whatever scaling that optimizes the display of the vectors.默认情况下, quiver3将使用任何优化矢量显示的缩放比例。

quiver3(...,scale) automatically scales the vectors to prevent them from overlapping , and then multiplies them by scale. quiver3(...,scale)自动缩放向量以防止它们重叠,然后将它们乘以比例。 scale = 2 doubles their relative length, and scale = 0.5 halves them. scale = 2 将它们的相对长度加倍,而 scale = 0.5 将它们减半。 Use scale = 0 to plot the vectors without the automatic scaling.使用 scale = 0 绘制没有自动缩放的向量。

You'll want to specify the scale parameter as 0 to prevent this automatic scaling and to accurately represent the data that you provide您需要将scale参数指定为0以防止这种自动缩放并准确表示您提供的数据

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

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM