Using solve command, to solve user defined function
14 views (last 30 days)
Show older comments
Roohullah Ansari on 17 Feb 2022
Answered: Prateek Rai on 21 Feb 2022
Suppose I write a function f(a,b,c,d).
I want to solve it using solve as
but whenever i used the above it gives error, showing use symb variable.
Torsten on 17 Feb 2022
You defined a,b,c and d as symbolic ? You want to solve b=1/f(a,b,c,d) for b ?
bsol = solve(b*f(a,b,c,d)==1,b)
Prateek Rai on 21 Feb 2022
You can use "syms" to create symbolic function with four arguments:
here, f is abstract symbolic function. It does not have symbolic expressions assigned to it.
Then, specify the following formula for f.
% formula for f
After that, you can use "solve" function:
Find more on Conversion Between Symbolic and Numeric 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!