how to find Y value in a parametric plot without cursor

2 ビュー (過去 30 日間)
Joseph Lee
Joseph Lee 2017 年 10 月 6 日
回答済み: Kian Azami 2017 年 10 月 6 日
how do i find the value of Y at a specific X position, eg X=1
t= linspace (0,50,10000);
X= (3*t)+ (1/sin(t))
Y= -2*cos(t)

回答 (1 件)

Kian Azami
Kian Azami 2017 年 10 月 6 日
To define the X matrix you need to put the "." before the "/" as below:
X= (3*t)+ (1./sin(t));
The Y is the function of t, so if you have the t you can find the value of Y easily.
But if you want to find a particular t so that X will have the value you want you can find the index of t first and then put that t inside the Y function and see the result. For example you want the X between 3 and 3.2, then you need to find the index of t that makes the X to be between 3 and 3.2. Then you put that t inside the Y and you find the value of Y.
idx = find(X >= 3 & X <= 3.2)
Y= -2*cos(t(idx));

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by