12.07.2015 Views

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

whosName Size Bytes Classdata 128x103x9 949248 double arrayf 1x103824 double arrayt 1x9 72 double arrayth 1x128 1024 double arrayThe data consists <strong>of</strong> spectra measured at 103 frequencies, 128 arrivalangles, <strong>and</strong> 9 time steps. Let us plot the fifth time sample:colormap(flipud(gray))imagesc(f,th,data(:,:,5))axis xycolorbarxlabel(’Frequency, Hz’)ylabel(’Arrival angle, degrees’)Darker colours correspond to higher intensities. You can see two strongsources at an angle <strong>of</strong> zero degrees <strong>and</strong> at frequencies <strong>of</strong> 85 <strong>and</strong> 170 Hz.The fact that 170 = 2 × 85 might lead us to suspect that the 170 Hzsource is just the first harmonic <strong>of</strong> the 85 Hz source. Let us look at all <strong>of</strong>the time samples together. This time we’ll cut <strong>of</strong>f the lower intensitiesby setting the minimum colour to correspond to an intensity <strong>of</strong> 5 (thisis the call to caxis in the following code). We also turn <strong>of</strong>f the y-axistick labels for all but the first plot, <strong>and</strong> we make the tick marks pointoutwards: 10for i = 1:9subplot(3,9,i), imagesc(f,th,data(:,:,i)), axis xyset(gca,’tickdir’,’out’)if i == 1ylabel(’Arrival angle, degrees’)xlabel(’Frequency, Hz’)endif i>1, set(gca,’yticklabel’,[]), endcaxis([5 Inf]), title([’i_t = ’ num2str(t(i))])end10 See H<strong>and</strong>le Graphics Sections 23 <strong>and</strong> 31 (pages 63 <strong>and</strong> 107).c○ 2000 by CRC Press LLC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!