Differentiation help with polynomial
Info
This question is closed. Reopen it to edit or answer.
Show older comments

Here is what I have so far im not sure if it is entirely correct but im having trouble comparing the data to see how close they come to each other
yest=[1147 777 479 253 99 17 7 69 203 409 687];%estimated y values using slopes between points
y=polyval(polyder([12 -5 0 3]),[-5:5]);
x=[-5:5];
figure(1);
subplot(1,2,1);
bar(x,y)
title('Y Calculated')
subplot(1,2,2)
bar(x,yest)
title('Y Estimated')
Answers (1)
Star Strider
on 3 Apr 2019
Since ‘y’ and ‘yest’ have the same number of elements, I would just subtract them (assuming they are with respect to the same (‘x’ values).
Two possibilities:
dydx_dif = y - yest; % Absolute Difference
dydx_dif = (y - yest)./y; % Relative Difference
Others certainly exist, such as the squares of the differences, the square root of the squares of the differences, and aggregate statistics based on those calculations, such as root-mean-square error for all of them.
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!