i need to change a mathematical formula inside a function from a script
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assumptions 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!