No BSD License  

Highlights from
Alternative Mathematics using MATLAB 7

image thumbnail

Alternative Mathematics using MATLAB 7

by

 

13 Mar 2003 (Updated )

Self-instructive text on undergraduate algebra, statistics, differential and integral calculus.

ex132.m
% ex132.m:  Plot a Function and its Derivative   
clear all
X=0: 0.01: 10;  Y=xcos(X);
h=1e-4;					 	% Fixed increment
Der=(xcos(X+h)- xcos(X))/ h;			% Quotient
figure(1),  plot(X,Y,  X,Der),  grid on,  
   legend('f=x*cos(x)', 'df/dx'),  xlabel('x')
Dex=cos(X)-X.*sin(X);	        			% Exact derivative
figure(2),  plot(X,Der,  X,Dex),  grid on,  legend('df/dx', 'exact')	
figure(3),  plot(X, Der- Dex),  grid on,  title('Error in df/dx')

Contact us