Plot 2D points in 3D space
显示 更早的评论
Hi there
So I'm struggling to find a way in which I can represent a 2D trjaectory in a 3D plot. I'm viewing the trajectory from a certain distance away from the origin.
Any help would be appreciated thanks!
1 个评论
darova
2019-9-12
What ideas do you have? Did you try something?
What about plot3()?
回答(1 个)
Star Strider
2019-9-12
Since your trajectory is defined by two vectors, if you want to plot it in 3D space, you need to provide another vector. The easiest way to do that is to define it as a vector of ones:
x = ...;
y = ...;
z = ones(size(x));
then plot all three vectors. Multiply the ones vector by the appropriate scalar to produce the result you want.
2 个评论
Christo van Rensburg
2019-9-13
Star Strider
2019-9-13
My pleasure.
If my Answer helped you solve your problem, please Accept it!
类别
在 帮助中心 和 File Exchange 中查找有关 2-D and 3-D Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!