how to write code to find y???

4 次查看(过去 30 天)
Maruti Patil
Maruti Patil 2015-3-13
评论: Adam 2015-3-13
I am new user to Matlab. I want to calculate the value of y for a given value of x
if x=8
x=(y^2)+2
how to write code to find y???

回答(1 个)

Adam
Adam 2015-3-13
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.
  2 个评论
Maruti Patil
Maruti Patil 2015-3-13
I want to calculate value of y without rearranging the equation. Although I have mentioned simple equation here, I have bigger equation...
Adam
Adam 2015-3-13
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by