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.

ex261.m
% ex261.m:  Fast Fourier Transform of a Gaussian  		                      
clear all
ns=2^12,  A=1;	 a=50;				
tlim=500*a;  dt= 2*tlim/(ns-1);  T=-tlim:dt:tlim ;         	
F=A*exp(-T.^2/ a^2);					% Target function 
G=fft(F);   									% Fast Fourier transform
N=1:ns;
figure(1),  plot( N,real(G),'b', N,imag(G),'r', N,abs(G),'k'),  grid on
   xlabel('index n'),  ylabel('real(G)=blue, imag(G)=red, abs(G)=black')
figure(2),  plot( N,real(G),'b', N,imag(G),'r', N,abs(G), 'k'),  grid on
   xlabel('index n'),  ylabel('real(G)=blue,  imag(G)=red  abs(G)=black')
   zoom on,  axis([1 50 get(gca,'Ylim')])  

Contact us