Solve f(x) with mex files

조회 수: 1 (최근 30일)
Matthias Stark
Matthias Stark 2015년 11월 23일
댓글: Matthias Stark 2015년 11월 23일
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

답변 (1개)

Walter Roberson
Walter Roberson 2015년 11월 23일
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
  댓글 수: 1
Matthias Stark
Matthias Stark 2015년 11월 23일
Thank you very much, the solver is working now Best regards

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by