Filter löschen
Filter löschen

Plot 2D points in 3D space

5 Ansichten (letzte 30 Tage)
Christo van Rensburg
Christo van Rensburg am 12 Sep. 2019
Kommentiert: Star Strider am 13 Sep. 2019
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 Kommentar
darova
darova am 12 Sep. 2019
What ideas do you have? Did you try something?
What about plot3()?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Star Strider
Star Strider am 12 Sep. 2019
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 Kommentare
Christo van Rensburg
Christo van Rensburg am 13 Sep. 2019
Hi
I'm using plot3 and managed to get it sorted, but thanks!
Star Strider
Star Strider am 13 Sep. 2019
My pleasure.
If my Answer helped you solve your problem, please Accept it!

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by