필터 지우기
필터 지우기

i need to change a mathematical formula inside a function from a script

조회 수: 2 (최근 30일)
Kobi
Kobi 2014년 3월 4일
답변: Walter Roberson 2014년 3월 5일
hi, i need to change a mathematical formula inside a function from a script. i think i shuld use a syms, so far i haven't realized how to do so,
clc
syms x
variable=x;
x=sym(variable);
a=cos(x);
a=subs(a,x,2)
this is my code above for a simple example, after substitute the x to 2 using subs i need to find a way to place this "new" formula in a function, matlab identify a as a 1x1 sym
any suggestions?

답변 (1개)

Walter Roberson
Walter Roberson 2014년 3월 5일
Try matlabFunction()

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by