Filter löschen
Filter löschen

Using abs in a polynomious

1 Ansicht (letzte 30 Tage)
mar vouz
mar vouz am 10 Jan. 2016
Bearbeitet: mar vouz am 26 Apr. 2016
uu

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 10 Jan. 2016
You cannot pass a function handle to polyval.
"The input argument p is a vector of length n+1 whose elements are the coefficients in descending powers of the polynomial to be evaluated."
Notice that your ap already does a polyval, so even if you invoked ap somehow it would be a mistake to use it in polyval afterwards.
You should just be using
y2 = abs(polyval(x2,p));
trapz(x2, y2)

Weitere Antworten (0)

Kategorien

Mehr zu Polynomials finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by