MATLAB: Creating a polyval function

MATLABpolyval

Hi everybody, I'm actually trying to create a function wich would work like a polyval function but without any S and MU. Just with p and x : polyval(p,x). http://www.mathworks.com/help/matlab/ref/polyval.html But I have absolutely no idea how to do it… I know what i would have to do on a paper but no idea in MATLAB. For example, i don't know how to write this in MATLAB : y = p1*x^n + p2*x^nā€“1 + ā€¦ + p*n^x + p*n+1 So if someone could just show me a tip or a way to find it… Thx šŸ™‚

Best Answer

Hi!
But you can use polyval with just p and x!