beamplt.m

来自「hi i have a huge collection are you int」· M 代码 · 共 51 行

M
51
字号
%BEAMPLT.M%%To produce a plot of the beam pattern given as a function of angle%for either%      (a) several different numbers of hydrophones at fixed spacing,%or    (b) several different hydrophone spacings with a fixed number of%          hydrophones.%%                   Andrew Knight, June 1991%Npts = 200;theta=linspace(0,pi/2,Npts);b=zeros(4,Npts);k = menu('BEAMPLT.M: Which would you like',...   'different numbers of hydrophones',...   'different hydrophone spacings');disp(' ')if k==1   disp('Beam patterns for the following numbers of hydrophones:')   n = [2 5 10 20];   disp(n)   dol = 0.5;   disp(['(Spacing = ' num2str(dol) ' wavelengths)'])   for i=1:4,b(i,:)=beam(n(i),dol,theta);endelse   disp('Beam patterns for the following hydrophone spacings (/lambda):')   dol = 0.15 + [.2 .4 .6 .8];   disp(dol)   n = 6;   disp(['(Number of hydrophones = ' int2str(n) ')'])   for i=1:4,b(i,:)=beam(n,dol(i),theta);endend%   Plotting:clghold offaxis([0 90 -4 0])semilogy(theta*180/pi,b)xlabel('theta (degrees)')ylabel('response')title('BEAMPLT.M')ans = input('Print current plot ? ','s');if ans=='y'|ans=='Y'   printendaxis([0 1 0 1])polar(theta,b);gridtitle('BEAMPLT.M: Beam pattern')disp('Type "print" if you want a printout')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?