12.07.2015 Views

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

156 <strong>GNU</strong> <strong>Octave</strong>argument is optional, and specifies how many diagonals above or below the maindiagonal should also be set to zero.The default value of k is zero, so that triu and tril normally include the maindiagonal as part of the result matrix.If the value of k is negative, additional elements above (for tril) or below (for triu)the main diagonal are also selected.The absolute value of k must not be greater than the number of sub- or superdiagonals.For example,tril (ones (3), -1)⇒ 0 0 01 0 01 1 0andtril (ones (3), 1)⇒ 1 1 01 1 11 1 1vec (x)Function FileReturn the vector obtained by stacking the columns of the matrix x one above theother.vech (x)Function FileReturn the vector obtained by eliminating all supradiagonal elements of the squarematrix x and stacking the result one column above the other.prepad (x, l, c)Function Filepostpad (x, l, c)Function Filepostpad (x, l, c, dim)Function FilePrepends (appends) the scalar value c to the vector x until it is of length l. If thethird argument is not supplied, a value of 0 is used.If length (x) > l, elements from the beginning (end) of x are removed until a vectorof length l is obtained.If x is a matrix, elements are prepended or removed from each row.If the optional dim argument is given, then operate along this dimension.18.3 Special Utility Matriceseye (x)Built-in Functioneye (n, m)Built-in Functioneye (..., class)Built-in FunctionReturn an identity matrix. If invoked with a single scalar argument, eye returnsa square matrix with the dimension specified. If you supply two scalar arguments,

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

Saved successfully!

Ooh no, something went wrong!