How do I find unknown parameter from an equation?

Suppose I am given an equation, z = a*b/(c*d)
Instead of z being the unknown, some term in the RHS is the unknown (let's say 'c') and I am given the values for all others ( let's say z=1, a=2, b=3, d=4).
So how do I find the unknown (here 'c') using the above equation?

 채택된 답변

Walter Roberson
Walter Roberson 2021년 4월 13일

0 개 추천

eqn = @(c) z - a.*b./(c.*d);
c = fsolve(eqn, GUESS)
This assumes that the equation is complex enough that you cannot just mentally doing the rewriting
z = a*b/(c*d)
implies z*c*d = a*b
implies c = a*b/(z*d)
There are other important similar cases, where you are given a inputs at a number of locations, and corresponding outputs, and you need to find the value of parameters. For example if you were given a constant a, and constant d, and given one b for each input and one corresponding output z, and the question was to find what single value of c best explained all of the (b,z) pairs, then in such a case you could use the Curvefitting Toolbox, or use Nonlinear Least Squares from the Optimization Toolbox; https://www.mathworks.com/help/optim/nonlinear-least-squares-curve-fitting.html

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기

제품

질문:

2021년 4월 13일

댓글:

2021년 4월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by