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.

Now we need to get the h<strong>and</strong>les <strong>of</strong> all the lines. We could have said h =plot(y) to get them, but for now we use the get function:h = get(gca,’children’)The gca function returns the h<strong>and</strong>le <strong>of</strong> the current axes, <strong>and</strong>get(gca,’children’) returns the h<strong>and</strong>les <strong>of</strong> all the current axes’ children(the lines on the plot). Now we want to change the thicknesses <strong>of</strong>the lines. We set up a vector <strong>of</strong> line widths with as many elements asthere are lines:widths = linspace(.1,10,length(h));The widths <strong>of</strong> the lines will vary from a minimum <strong>of</strong> 0.1 to a maximum<strong>of</strong> 10. We use a for-loop to change the width <strong>of</strong> each <strong>of</strong> the lines:for i = 1:10set(h(i),’linewidth’,widths(i));end24 DemosThe matlab demos are well worth browsing. You can learn about asubject (<strong>of</strong>ten reading references are given), as well as learning aboutmatlab’s capabilities. Of interest to sonar <strong>and</strong> radar signal processors ismatlab’s Higher Order Spectral Analysis toolbox containing, for example,functions for direction <strong>of</strong> arrival estimation (beamforming plus othermethods), time-frequency distributions, <strong>and</strong> harmonic estimation. Typehelp hosa for a list <strong>of</strong> functions in the Higher Order Spectral Analysistoolbox. Browsing the demos or doing a keyword search may save youfrom writing your own matlab code <strong>and</strong> re-inventing the wheel. Typedemo to get the panel:c○ 2000 by CRC Press LLC

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

Saved successfully!

Ooh no, something went wrong!