next Vectors and Matrices
up Music 270a: Matlab Tutorial 1
previous Basic Functions


Variables

Rather than using hard coded numbers, it makes sense to use variables. Variables are useful because they can be used in an expression instead of the value they hold, making the expression more meaningful for the programmer. They can be given any name you wish (as long as it isn't already in use by Matlab).

>> x = 3*2.0

ans = 

6

>> y = x + 2

ans = 

8

Try the following:

>> x <return> 
>> who <return>
>> whos <return>
>> clear all <return>
>> whos <return>


next Vectors and Matrices
up Music 270a: Matlab Tutorial 1
previous Basic Functions

``Music 270a: Digital Audio Processing'' by Tamara Smyth, Department of Music, University of California, San Diego (UCSD).
Download PDF version (matlabtut1.pdf)
Download compressed PostScript version (matlabtut1.ps.gz)

Copyright © 2013-01-07 by Tamara Smyth.
Please email errata, comments, and suggestions to Tamara Smyth<trsmyth@ucsd.edu>