Im trying to create a 3d plot of 10 trajectories. I have the equation for the z axis and the x axis as an array. However i would like to start the plot at a point along the y axis instead of zero. I know how I want to go plotting the trajectories, it's getting the plot to start at a given point on the y axis. For example starting at the point (0 24 0) or (0 26 2).

댓글 수: 5

Ameer Hamza
Ameer Hamza 2020년 4월 6일
What are the equations of these trajectories?
darova
darova 2020년 4월 6일
What is the question?
v= 6.5;%ft/s
g= 32.2; %ft/s^2
theta= 30; %degrees
x= 0:.1:2;
y= randi(48);
z1= (x*tand(theta)-((g*x.^2)/(2*v^2*.75)));
plot3(x,y,z1)
Above is the code i have so far. I want to treat the y axis as the beginning of the trajectory. However i wish to start the trajectory at a given y coordinate between 0 and 48. So my question is how to start the trajectory at a specific y coordinate. Also disregard the "y= randi(48)" i know that it is wrong.
Tyler Hajovsky
Tyler Hajovsky 2020년 4월 6일
This is the plot of the trajectory in 2d, given that the code for this plot is "plot(*x,z1)". I would like to make this plot 3d by adding in the y axis and starting the trajectory at a specific y coordinate.
Marcos
Marcos 2024년 11월 27일
이동: Walter Roberson 2024년 11월 27일
How to plot a initial point to final point in 3D graphics, using simultanious trajectory definite vs real time trajectory real PSO

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

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 4월 6일
편집: Ameer Hamza 2020년 4월 6일

0 개 추천

Try this
v= 6.5;%ft/s
g= 32.2; %ft/s^2
theta= 30; %degrees
x= 0:.1:2;
y= randi(48)*ones(size(x));
z1= (x*tand(theta)-((g*x.^2)/(2*v^2*.75)));
plot3(x,y,z1)
grid on
xlabel('x');
ylabel('y');
zlabel('z');

댓글 수: 4

Tyler Hajovsky
Tyler Hajovsky 2020년 4월 6일
YEEEESSSSSSS. Thank you so much, did you just create an empty array the size of x?
Ameer Hamza
Ameer Hamza 2020년 4월 6일
It is not empty array. It is array of all ones. I have updated the code to clarify it.
Tyler Hajovsky
Tyler Hajovsky 2020년 4월 6일
Thank you so much!!
Ameer Hamza
Ameer Hamza 2020년 4월 6일
Glad to be of help.

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

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

질문:

2020년 4월 6일

이동:

2024년 11월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by