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!