Differentiation help with polynomial
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论

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')
0 个评论
回答(1 个)
Star Strider
2019-4-3
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.
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!