No BSD License  

Highlights from
Numerical Methods for Physics

from Numerical Methods for Physics by Alejandro Garcia
Companion Software

jacobi_p.m
clear;  %%% Plot data from jacobi.f %%%
load x.dat; load y.dat; load phi.dat; load change.dat;
subplot(121)
  cs = contour(rot90(phi),9,x,y);  % Contour plot with labels
  xlabel('x'); ylabel('y'); clabel(cs,[.2 .4 .6 .8]);
subplot(122)
  mesh(phi);   % Wire-mesh plot of potential
subplot(111)
title('Potential');
pause;  % Pause between plots; strike any key to continue
semilogy(change);
xlabel('iteration');  ylabel('fractional change');
   

Contact us at files@mathworks.com