quiver3返回长度不正确的向量

时间:2015-04-21 18:27:28

标签: matlab matlab-figure

我有一组矢量

t = [ -1    -1     0
       1    -1     0
       1     1     0
      -1     1     0 ]

当顺序绘制(头到尾)时,这些向量形成正方形

我正在使用quiver3指令获取这些向量的图,如下所示:

quiver3(starts(:,1), starts(:,2), starts(:,3), t(:,1), t(:,2), t(:,3))

我计算了#34;开始"通过矩阵t的累积和得到以下结果

starts = [ 0     0     0
          -1    -1     0
           0    -2     0
           1    -1     0]

所有值都非常有意义,并且如果手动绘制则会给出正方形,但quiver3返回以下图

enter image description here enter image description here

为什么不是矢量'头撞着尾巴?我该如何解决?

1 个答案:

答案 0 :(得分:3)

您需要将AutoScaleFactor设置为 1

t = [...
    -1    -1     0
     1    -1     0
     1     1     0
    -1     1     0]

starts = [...
     0     0     0
    -1    -1     0
     0    -2     0
     1    -1     0]

quiver3(starts(:,1), starts(:,2), starts(:,3), t(:,1), t(:,2), t(:,3), ...
        'AutoScaleFactor',1)

enter image description here

默认设置为 0.9 ,因为整个矢量字段看起来有点乱。否则。


编辑:看看这对你有何用处:

 starts = [ 0 0 0; -13 12 0]
 t = [ -13 12 0; -1 2 0]

 quiver3(starts(:,1), starts(:,2), starts(:,3), t(:,1), t(:,2), t(:,3), 0)
 view(0,90)

0 定义固定比例因子, 0 表示无比例缩放。 enter image description here

相关问题