No BSD License  

Highlights from
Numerical Methods for Physics

from Numerical Methods for Physics by Alejandro Garcia
Companion Software

sprfft_p.m
clear;  %%% Plot data from sprfft.f %%%
load tplot.dat;  load xplot.dat; 
load f.dat;  load spect.dat;  load spectw.dat;
temp = size(xplot);
nstep = temp(1);
ipr = 1:16:nstep;
plot(tplot,xplot(:,1),'-',tplot(ipr),xplot(ipr,1),'o',...
     tplot,xplot(:,2),'-.',tplot(ipr),xplot(ipr,2),'+',...
     tplot,xplot(:,3),'--',tplot(ipr),xplot(ipr,3),'*')
title('Displacement of Mass 1- o  2- +  3- *');
xlabel('Time'); ylabel('Displacement');
pause;  % Pause between plots; strike any key to continue
semilogy(f(1:(nstep/2)),spect(1:(nstep/2)),'-',...
         f(1:(nstep/2)),spectw(1:(nstep/2)),'--');
title('Power Spectrum (Dashed is windowed data)');
xlabel('frequency'); ylabel('Power');

Contact us at files@mathworks.com