필터 지우기
필터 지우기

Turn a numeric function into a symbolic one

조회 수: 7 (최근 30일)
Antonio
Antonio 2012년 5월 11일
Hi all,
do you know ho to turn a function with numeric input and output into a symbolic function?
Thanks!

답변 (2개)

Doug Hull
Doug Hull 2012년 5월 11일
You will have to enter the function manually if you know it.
  댓글 수: 2
Antonio
Antonio 2012년 5월 11일
Ok, so I guess it is not possible since my numerical function depends on other numerical functions to be defined.
Antonio
Antonio 2012년 5월 11일
I should define all the functions as symbolic ones

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


Walter Roberson
Walter Roberson 2012년 5월 11일
In the case where the numeric function only involves mathematical calculations with respect to the parameter you wish to be symbolic, then pass a symbol to the numeric function.
If the numeric function has any part that is conditional on the input value (e.g., an "if" statement) then there is no mechanical way of handling the situation.
  댓글 수: 3
Antonio
Antonio 2012년 5월 11일
and eventually get a symbolic result?
Walter Roberson
Walter Roberson 2012년 5월 11일
Just call the function passing in a symbolic variable. Operator overloading takes care of the details.
For example,
f = @(x) sin(cos(x)^2-tan(x))
then
syms p
f(p)

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

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by