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.

Chapter 18: Matrix Manipulation 159randperm (n)Function FileReturn a row vector containing a random permutation of the integers from 1 to n.diag (v, k)Built-in FunctionReturn a diagonal matrix with vector v on diagonal k. The second argument isoptional. If it is positive, the vector is placed on the k-th super-diagonal. If it isnegative, it is placed on the -k-th sub-diagonal. The default value of k is 0, and thevector is placed on the main diagonal. For example,diag ([1, 2, 3], 1)⇒ 0 1 0 00 0 2 00 0 0 30 0 0 0The functions linspace and logspace make it very easy to create vectors with evenlyor logarithmically spaced elements. See Section 4.2 [Ranges], <strong>page</strong> 37.linspace (base, limit, n)Built-in FunctionReturn a row vector with n linearly spaced elements between base and limit. Thenumber of elements, n, must be greater than 1. The base and limit are always includedin the range. If base is greater than limit, the elements are stored in decreasing order.If the number of points is not specified, a value of 100 is used.The linspace function always returns a row vector.logspace (base, limit, n)Function FileSimilar to linspace except that the values are logarithmically spaced from 10 base to10 limit .If limit is equal to π, the points are between 10 base and π, not 10 base and 10 π , in orderto be compatible with the corresponding Matlab function.warn neg dim as zeroBuilt-in VariableIf the value of warn_neg_dim_as_zero is nonzero, print a warning for expressions likeeye (-1)The default value is 0.warn imag to realBuilt-in VariableIf the value of warn_imag_to_real is nonzero, a warning is printed for implicit conversionsof complex numbers to real numbers. The default value is 0.

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

Saved successfully!

Ooh no, something went wrong!