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.

ex195.m
% ex195.m:  Euler Solution for dy/dx= sin(x y)				        
clear all
F=inline('sin(X.*Y)', 'X', 'Y');
X(1)=input('x1=  (e.g. 0) ');  Y(1)=input('y1=  (e.g. 3) ');
n=500;  h=0.01;
for i=1:n
   dy=F( X(i), Y(i))*h;
   X(i+1)=X(i)+h;
   Y(i+1)=Y(i)+dy;
end
figure(1),  plot(X,Y),  grid on,  axis([0 n*h 0 5])		% First figure(1)
   title( 'dy/dx= sin(x y)'),  xlabel('x')		% Eliminate the direction field
	

Contact us