Intrinsic functions: zeros, izeros, rzeros, czeros
zeros(nx) returns a real zeroed vector of length nx, zeros(nx,ny) returns a zeroed real matrix and so on. You can use it to "dimension" arrays that are indexed later, and to set the initial value to zero. The companion functions izeros and czeros create integer and complex zeroed arrays, respectively. rzeros is a synonym for zeros.
Intrinsic function: abs
abs(x) returns the absolute value of x, which may be of any numeric object. If x is an array, the operation is performed componentwise. If x is a string, an integer vector of the character ASCII codes is returned.
Intrinsic functions: min, max
min(x) returns the smallest element of array x, or x itself if x is scalar.
min(x,y) returns the smaller of x and y. If both are arrays, their dimensions must agree. If one is scalar, it is promoted to array if needed.
min(x,y,...,z) effectively expands to min(x,min(y,...z)...).
The function max works similarly. The arguments may not be complex.
Intrinsic functions: Nargin, Nargout
Nargin() returns the number of optional arguments passed to current function. Optional arguments are specified using the ellipsis (...) notation in the formal argument list. You may not use Nargin() in functions whose argument list does not end with an ellipsis.
Nargout() works similarly. For example, the following function f can be called with any number of input/output arguments; it displays the numbers:
function [...] = f(...) {
format("`` input args, `` output args.\n",Nargin(),Nargout())
};
See also: argin
Intrinsic functions: argin, argout, SetArgOut
The function argin(n) returns the n-th optional input argument. The first optional argument has n=1. Similarly, argout(n) returns the value of the n-th optional output argument.
SetArgOut(n,x) sets the n-th optional output argument to x.
Please notice that the functions argin, argout and SetArgOut do not count the preceeding 'normal' arguments, but the first optional always has index n=1.
See also: Nargin
Intrinsic function: nop
nop() generates a 'no-operation' instruction. It is useful (?) for benchmarking purposes. For example,
nop(); nop(); nop(); nop(); nop();
generates five NOP instructions in the flatcode stream.
Next Chapter, Previous Chapter
Table of contents of this chapter, General table of contents
Top of the document, Beginning of this Chapter