Solve f(x) with mex files
1 view (last 30 days)
Show older comments
Hello together,
i have the following problem.
An Matlab add-in gives me (via mex files) the possibility to generate Steam-Properties
e.g. function xs_ph_97(p,h) gave me the xs value of the steam.
So i have the following problem:
The i need to solve the function F(x) = (xs_ph_97(x,h) == 0,5).
When i create a script with
syms f(x)
f(x) = (xs_ph_97(x,h) == 0,5)
I get following error:
!x_ph_97: unreasonable type or size of argument 1!
Can somebody help me
Best regards
0 Comments
Answers (1)
Walter Roberson
on 23 Nov 2015
h = some appropriate value
x0 = initial value of x to check
Fx = fzero(@(x) xs_ph_97(x,h) - 0.5, x0);
This is not a function because there is a single x solution (or one solution for each h value): Fx will be the x that solves xs_ph_97(x,x) == 0.5
See Also
Categories
Find more on Ordinary Differential Equations 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!