svradscoup.m


Here is a short program that generates the radiation pattern from a single couple (and double couple) seismic source.  It is a simple script which isn't even defined as a Matlab function.


 
 
svradscoup.m
More comments
%svradscoup
%  generate the SV wave radiation pattern from a single couple source
clear;
set(0,'DefaultFigurePaperPositionMode','auto');
ndiv=25;
i=0;
for theta = 0:pi/ndiv:pi;
   i=i+1;
   j=0;
   for phi = 0:pi/ndiv:2*pi;
      j=j+1;
      r=abs(sin(2*theta)*sin(2*phi));
      x(i,j)=r*sin(theta)*cos(phi);
      y(i,j)=r*sin(theta)*sin(phi);
      z(i,j)=r*cos(theta);
   end
end
figure
surf(x,y,z);
axis equal;

 
 
 
 

Use ":" function to generate 25 values for the angle theta between
   0 and pi.

Use ":" function to generate 25 values for the angle phi between
  0 and 2pi.

This is the radiation pattern in cartesian coordinates.
 
 
 

Define a new figure.
Use the "surf" function to plot it.
Make sure the axes are of equal length.



Here is what it looks like:


Matlab WebSite: http://www.mathworks.com/



 

Back