The name has nothing to do with musical octaves. Octave is named after a former professor of the principal author, who was known for his ability to perform quick back-of-an-envelope calculations.
Octave programs consist of a list of function calls or script. The language is matrix-based and provides various functions for matrix operations. It is not object-oriented, but supports data structures.
Its syntax is very similar to MATLAB, and carefully programming a script will allow it to run on both Octave and MATLAB.
Because Octave is made available under the GNU General Public License, it may be freely copied and used. The program runs under most Unix and Unix-like operating systems, as well as Microsoft Windows.
octave:1> x.a = 1; x.b = [1, 2; 3, 4]; x.c = "string"; octave:2> x.a x.a = 1 octave:3> x.b x.b =Short-circuit boolean operators: Octave's `&&' and `||' logical operators are evaluated in a short-circuit fashion (like the corresponding operators in the C language), in contrast to the element-by-element operators `&' and `|'.Increment and decrement operators: Octave includes the C-like increment and decrement operators `++' and `--' in both their prefix and postfix forms. Unwind-protect: Octave supports a limited form of exception handling modeled after the unwind-protect form of Lisp. The general form of an unwind_protect block looks like this:1 23 4octave:4> x.c x.c = string
unwind_protectVariable-length argument lists: Octave has a real mechanism for handling functions that take an unspecified number of arguments without explicit upper limit. To specify a list of zero or more arguments, use the special argumentbodyunwind_protect_cleanupcleanupend_unwind_protect
varargin as the last (or only) argument in the list.function s = plus (varargin)Variable-length return lists: A function can be set up to return any number of values by using the special return valueif (nargin==0)s = 0;elses = varargin{1} + plus (varargin{2:nargin});endifendfunction
varargout. For example:function varargout = multiassign (data)for k=1:nargoutvarargout{k} = data(:,k);endforendfunction