The first example squares each element of b; the second raises 2 to each of the powers
given in b.
All of the element-by-element vector commands (+ - ./ .* .^) can be used between two
vectors, as long as they are the same size and shape. Otherwise corresponding elements
cannot be found and an error is given.
Most of Octave’s functions also know about vectors. For example, to create a list of
the value of sine at 60-degree intervals, you just need to pass a vector of angles to the sin
function: