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.

ex144.m
% ex144.m:  Power Series for sin(x)  					
clear all,  format long;			
x=input('x= (e.g. 1) ');
term=x;  s=x;  i=0;				% Initial values
while 1==1						% Forever
   i=i+1;						% Next index
   term=term*(-x^2)/(2*i+1)/(2*i);
   s=s+ term;
   if abs(term)<1e-15;  break;  end;
end
last_index_in_sum=i							
sum=s,  sin_ex=sin(x)
format short e,  error=s- sin(x)		% Scientific notation

Contact us