Professional Documents
Culture Documents
'-GX' '-Ko' '-.R'
'-GX' '-Ko' '-.R'
error_percentagef= abs((dydx
error_percentageb= abs((dydx
error_percentagec= abs((dydx
%calculate error percentages
-dydxf)./dydx)*100;
-dydxb)./dydx)*100;
-dydxc)./dydx)*100;
for all three techniques with respect to analytical va
plot(x,dydx,'b')
%plot the analytical derivative function on the same graph with blue line
title({'Forward, Backward, and Central Difference Approximation of';'the derivative
xlabel('x');ylabel('dydx')
%put down the title of the graph and also label axis x as x and axis y as the deriv
legend('dydxf','dydxb','dydxc','dydx')
%add legend for all line curves generated.