How to solve multivariable expression?

2 views (last 30 days)
Krishan
Krishan on 21 Sep 2012
Hi,basic question.
I'm trying to solve this expression for some real numbers. How can I type it into MATLAB?
4*x+5*y+6*z = 122
Thanks.

Answers (1)

Matt J
Matt J on 30 Sep 2012
As an example, if I solve this in terms of x and implement it as an anonymous function in MATLAB
x=@(y,z) (122-5*y-6*z)/4
And now I can obtain x for any given (y,z) pair, e.g.,
>> x(2,2)
ans =
25

Categories

Find more on Mathematics and Optimization 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!