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.

ex253a.m
% ex253a.m:  Transform of an Odd Function, Periodicity
clear all
ns=1001;  A=1;  a=200;  tlim=20/a;
dt=2*tlim/(ns-1); 							% Time increment   
T=-tlim:dt:tlim;         						% Sample points, input variable
F=A*exp(-a* abs(T)).* sign(T);  		% Odd exponential
figure(1),  plot(T,F),  grid on			% Show input function
   xlabel('time t'),  ylabel('function f(t)'),  axis([-tlim tlim get(gca,'Ylim')])
Nu=linspace(-50*a, 50*a, 500);  
period=1/dt
G=sft(T, F, Nu);   						% Simple Fourier transform
W=2*pi*Nu;								% Angular frequency
Gex=-2*A*W./(a^2+W.^2);		
figure(2),  plot( Nu,real(G), Nu,imag(G), Nu,Gex,'--'),  grid on, zoom on
   xlabel('frequency'),  ylabel('transform G'),  
   legend('real', 'imaginary', 'Gex')  
   axis([min(Nu) max(Nu) get(gca,'Ylim')])  

Contact us