Column vector plotting issue

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.

 Respuesta aceptada

KSSV
KSSV el 31 de Oct. de 2016

0 votos

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

Más respuestas (0)

Categorías

Preguntada:

N/A
el 31 de Oct. de 2016

Respondida:

el 31 de Oct. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by