Solve f(x) with mex files
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (1개)
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!