Clear Filters
Clear Filters

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

10 views (last 30 days)
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?

Answers (1)

Walter Roberson
Walter Roberson on 8 Feb 2016
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.

Categories

Find more on Programming in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!