<< Chapter < Page | Chapter >> Page > |
You can use the colon several ways in MATLAB (see help :). Its basic meaning is a vector of sequential values. For example, type
to get
For increments other than 1, use statements like
Most MATLAB functions will accept vector inputs and produce vector out- puts. The statement
builds a vector of integers from 1 to 10 and takes the square root of each of those numbers. Try it.
Now for another subtlety–what is the effect of each of the following statements and why?
Appending to a Matrix or Vector. A matrix or vector can be
enlarged in size by appending new values to the old values. Let:
x=[1 3 5]
Notification Switch
Would you like to follow the 'A first course in electrical and computer engineering' conversation and receive update notifications?