MATLAB Answers

Kobi
0

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

Asked by Kobi
on 4 Mar 2014
Latest activity Answered by Walter Roberson
on 5 Mar 2014
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?

  0 Comments

Sign in to comment.

Products

1 Answer

Answer by Walter Roberson
on 5 Mar 2014

Try matlabFunction()

  0 Comments

Sign in to comment.