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!