ending a line in a plot

I need to make a ramp for a "motorcycle jump" simulation that is 15 m long and end there with angle chosen by user. In the axes I can't figure out how to get the line to stop at 15
% Equations for plot
%L is the length
%angle is alpha
alpha = input('input ramp degree: ')
L=15
ramp =(L*cosd(alpha));
ramp = [0, 15]
plot([x])
xlim([0,70])
ylim([0, 70])

2 件のコメント

Image Analyst
Image Analyst 2018 年 10 月 17 日
Try
xlim([0, 15]);
but, what is x?
andrew krugle
andrew krugle 2018 年 10 月 17 日
編集済み: Jan 2018 年 10 月 17 日
That does limit the entire graph to 15 but I was looking to have the graph be 70 long and the line end at a length of 15 like this

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2018 年 10 月 17 日

0 投票

For what it's worth, see my attached demo on projectiles. It computes just about everything you could possibly ever want to know about a projectile, and give you lots of input parameters like angle, initial velocity, initial height, etc.

カテゴリ

ヘルプ センター および File ExchangeGravitation, Cosmology & Astrophysics についてさらに検索

質問済み:

2018 年 10 月 17 日

回答済み:

2018 年 10 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by