MATLAB (a registered trademark of MathWorks, Inc.) is a language and interactive environment for numeric computation, algorithm development, data analysis, and data visualization. It is particularly well suited for digital signal processing applications. While MATLAB is relatively simple to use, it is a sophisticated package that can be a bit intimidating to new users. Fortunately, there are many excellent resources on MATLAB and its use, including MATLAB's own built-in documentation. This appendix provides a brief introduction to MATLAB that complements the MATLAB material found throughout this book.
Scripts and Help
When MATLAB is launched, a command window appears. Users issue commands at the command prompt (≫), and MATLAB responds, generally with the creation or modification of workspace objects. MATLAB supports different types of workspace objects, such as functions and strings, but usually objects are just data. The workspace window summarizes the names and important characteristics of currently available objects.
While users can directly input sequences of commands at the command prompt, it is generally preferable to instead use a MATLAB script file (M-file). A MATLAB script file is simply a text file (.m extension) that contains a collection of MATLAB statements. Comments are inserted by preceding text with a percent sign (%). Any text editor can be used to create an M-file, but MATLAB's built-in editor provides added functionality such as color-coded text, breakpoints, and various other features. M-files are easy to modify and facilitate rapid algorithm development. M-files are executed directly from MATLAB's editor or by typing the M-file name (without the .m extension) at the command prompt.