i have problem in uses of inline or syms ordes
1 次查看(过去 30 天)
显示 更早的评论
i want have a variable like x that define on x ,f(x) function,then program does math operators on f(x) and compute the result of this operators for specified x,
for example in During the a code i want define x with syms order and obtain f=x^2+x+1, then compute f(1)^2
0 个评论
采纳的回答
Walter Roberson
2015-5-16
syms x
f = x^2+x+1;
subs(f^2,x,1)
3 个评论
Walter Roberson
2015-5-16
The result of a computation with symbolic values is a symbolic value. If you want the closest floating point equivalent, double() the symbolic value. For example,
double(subs(f^2,x,1))
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Function Creation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!