我根据一篇文章在下面的 Octave 中编写了一个脚本: 如何在 MATLAB 中绘制向量(物理 2D/3D 向量)?
我在 Octave 中有以下代码,并且在第 3 行第 1 列附近收到错误“向量”未定义
谁能帮我?我已经为 Octave 编写了一些其他 *.m 文件,没有问题,现在我被卡住了。
a = [0 0 1]; %# Vector 1
b = [0.894 0 0.447]; %# Vector 2
c = [0.276 0.851 0.447]; %# Vector 3
d = [-0.724 0.526 0.447]; %# Vector 4
e = [-0.724 -0.526 0.447]; %# Vector 5
f = [0.276 -0.851 0.447]; %# Vector 6
g = [0.724 0.526 -0.447]; %# Vector 7
h = [-0.276 0.851 -0.447]; %# Vector 8
i = [-0.894 0 -0.447]; %# Vector 9
j = [-0.276 -0.851 -0.447] %# Vector 10
k = [0.724 -0.526 -0.447]; %# Vector 11
l = [0 0 -1]; %# Vector 12
starts = zeros(3,3);
ends = [a;b;c;d;e;f;g;h;i;j;k;l];
quiver3(starts(:,1), starts(:,2), starts(:,3), starts(:,4), starts(:,5),
starts(:,6), starts(:,7), starts(:,8), starts(:,9), starts(:,10),
starts(:,11), starts(:,12), ends(:,1), ends(:,2), ends(:,3),
ends(:,4), ends(:,5), ends(:,6), ends(:,7), ends(:,8), ends(:,9),
ends(:,10), ends(:,11), ends(:,12), 0)
axis equal