how to write code to find y???

2 views (last 30 days)
Maruti Patil
Maruti Patil on 13 Mar 2015
Commented: Adam on 13 Mar 2015
I am new user to Matlab. I want to calculate the value of y for a given value of x
if x=8
how to write code to find y???

Answers (1)

Adam on 13 Mar 2015
y = [-1 1] .* sqrt( x - 2 );
This is maths rather than Matlab though. Once you rearrange the equation the Matlab code for it is trivial!
There are numerous ways to code it and if you don't care about the negative root then it is even more trivial.
Adam on 13 Mar 2015
You probably need the Symbolic Math Toolbox for that then, although it isn't something I do in my work so there may be methods in base Matlab too.

Sign in to comment.


Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by