How to find the value of a variable based on when another variable equals a certain number

10 次查看(过去 30 天)
So what I'm trying to accomplish is to find the value of X right before Y is greater than D in my function
function [Result] = hw(D)
My X equation and my Y equation are
X = V.*T
Y = 0.5.*(9.81).*(T.^2)
Now I have to find X at the instance right before Y is greater than D. I would then have to incorporate that X into a vector so I made a new X called X_2. To solve X_2, I'd have to find the time (T) at which Y is less than D. If I do something like
T_ = (sqrt(2.*(Y)/9.81))
that would give me the T_ so I can put T_ into X_2, but how would I make it so I find the T right before Y is greater than D?

回答(1 个)

Walter Roberson
Walter Roberson 2016-2-8
No you cannot do that. Your X and your Y have no computation in common, so it is meaningless to talk about an X before or after a particular Y.

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by