Make the x-axis limit depend on the function y

Hi,
I'd like the maximum value of the x-axis to be at the point y=0.9 (graph is from 0 to 1 on the y-axis).
When I change the inputs in my function file, I want the x-axis to automatically stop when the line passes the theoretical y=0.9 line because the curve becomes asymptotic (to y=1) and makes the important bit hard to see.
Thanks.

 採用された回答

jackoboy9
jackoboy9 2016 年 6 月 8 日

0 投票

Figured it out. I used the find() syntax.

その他の回答 (1 件)

KSSV
KSSV 2016 年 6 月 8 日
編集済み: KSSV 2016 年 6 月 8 日

0 投票

Get the respective of x at y = 0.9..say it is xval..then use axis([0 xval 0 1]) after plotting

2 件のコメント

jackoboy9
jackoboy9 2016 年 6 月 8 日
I can't figure out how to do that because my function y is quite complicated.
jackoboy9
jackoboy9 2016 年 6 月 8 日
編集済み: jackoboy9 2016 年 6 月 8 日
To expand, let's say the graph is a plot of y against x.
My y is:
m(:,:,3)
which is a matrix of values that come from a complicated equation involving a definite integral
and x is
v^2*t/(2*a)

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

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

製品

質問済み:

2016 年 6 月 8 日

回答済み:

2016 年 6 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by