Plotting vector using scatter cloud
2 次查看(过去 30 天)
显示 更早的评论
I have a 100 3D vectors created using:
V = round(rand(100,3)*2-1);
I want to plot this vector in 3D using scatter3 (scatter cloud) but I need x y z values of the vector. How do I extract the x y z values. So the code I need to run is :
x = ...;
y = ...;
z = ...;
scatter3(x,y,z)
But I don't know how to get the x y z.
0 个评论
采纳的回答
Image Analyst
2016-10-28
Extracting columns is one of the most basic things you can do in MATLAB. Do this:
V = 2 * randi(2, 100, 3) - 3;
x = V(:, 1);
y = V(:, 2);
z = V(:, 3);
scatter3(x, y, z);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Scatter Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!