Column vector plotting issue

1 次查看(过去 30 天)
N/A
N/A 2016-10-31
回答: KSSV 2016-10-31
I create a 3D column vector and plot it using scatter3. When I was using a row vector the code was working fine but with column vector I'm unable to get the x y z values.
v = 2 * randi(2, 3, 1) - 3;
x = v(:, 1);
y = v(:, 2);
z = v(:, 3);
figure
scatter3(x, y, z);
Thank you.

采纳的回答

KSSV
KSSV 2016-10-31
v = 2 * randi(2, 3, 1) - 3;
x = v(1,:);
y = v(2,:);
z = v(3,:);
figure
scatter3(x, y, z);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by