필터 지우기
필터 지우기

Plot 2D points in 3D space

조회 수: 5 (최근 30일)
Christo van Rensburg
Christo van Rensburg 2019년 9월 12일
댓글: Star Strider 2019년 9월 13일
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
darova 2019년 9월 12일
What ideas do you have? Did you try something?
What about plot3()?

댓글을 달려면 로그인하십시오.

답변 (1개)

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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile 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!

Translated by