how to find Y value in a parametric plot without cursor
2 次查看(过去 30 天)
显示 更早的评论
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)
0 个评论
回答(1 个)
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));
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!