Function instead of polyval
显示 更早的评论
Is there a Matlab built in function that can be used instead of a polyval function. Or any few lines can work similarly like the polyval function because i dont want to use the polyval function.
采纳的回答
更多回答(1 个)
Azzi Abdelmalek
2012-8-7
编辑:Azzi Abdelmalek
2012-8-7
fval=@(p,x) sum((x.^[length(p)-1:-1:0].*p));
%example
p=[2 4 5 3]; x=2;
result=fval(p,x) % fval is your new function
4 个评论
Yash
2012-8-7
Azzi Abdelmalek
2012-8-7
ok try this
fval=@(p,x) sum((x.^[length(p)-1:-1:0].*p));
%example
p=[2 4 5 3]; x=2;
result=fval(p,x) % fval is your new function
Yash
2012-8-7
Yash
2012-8-7
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!