A command-line interface is a mechanism for interacting with a computer operating system or software by typing commands to perform specific tasks...
(CLI) for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with MATLAB
MATLAB
MATLAB is a numerical computing environment and fourth-generation programming language. Developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages,...
Batch processing is execution of a series of programs on a computer without manual intervention.Batch jobs are set up so they can be run to completion without manual intervention, so all input data is preselected through scripts or command-line parameters...
The GNU Project is a free software, mass collaboration project, announced on September 27, 1983, by Richard Stallman at MIT. It initiated GNU operating system development in January, 1984...
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....
(GPL).
History
The project was conceived around 1988. At first it was intended to be a companion to a chemical reactor design course. Real development was started by John W. Eaton
John W. Eaton
For other people named John Eaton, see John Eaton .John W. Eaton is the initial and main author of Octave, a system for numerical computations with a language that is mostly compatible with MATLAB, but is free software....
in 1992. The first alpha release dates back to January 4, 1993 and on February 17, 1994 version 1.0 was released. Version 3.0 was released on December 21, 2007.
Octave Levenspiel is an Emeritus professor of chemical engineering at Oregon State University. His principal interest has been chemical reaction engineering, a branch of chemical engineering studying the application of chemical reaction kinetics and physics to the design of chemical reactors.He...
A back-of-the-envelope calculation is a rough calculation, typically jotted down on any available scrap of paper such as the actual back of an envelope...
s.
Deployments
In addition to use on desktops for personal scientific computing, Octave is used in academia and industry. For example, Octave was used on a massive parallel
Parallel computing
Parallel computing is a form of computation in which many calculations are carried out simultaneously, operating on the principle that large problems can often be divided into smaller ones, which are then solved concurrently . There are several different forms of parallel computing: bit-level,...
computer at Pittsburgh supercomputing center to find vulnerability related to guessing social security numbers.
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...
The Standard Template Library is a C++ software library which later evolved into the C++ Standard Library. It provides four components called algorithms, containers, functors, and iterators. More specifically, the C++ Standard Library is based on the STL published by SGI. Both include some...
- License :Despite gnuplot's name, it is not part of or related to the GNU system and it is not distributed under the GNU General Public License .However, some GNU packages do use gnuplot....
Grace is a free WYSIWYG 2D graph plotting tool, for Unix-like operating systems. The package name stands for "GRaphing, Advanced Computation and Exploration of data." Grace uses the X Window System and Motif for its GUI. It has been ported to VMS, OS/2, and Windows 9*/NT/2000/XP...
software to create plots, graphs, and charts, and to save or print them.
Octave, the language
The Octave language is an interpreted programming language. It is a structured programming language (similar to C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....
The C Standard Library is the standard library for the programming language C, as specified in the ANSI C standard.. It was developed at the same time as the C POSIX library, which is basically a superset of it...
POSIX , an acronym for "Portable Operating System Interface", is a family of standards specified by the IEEE for maintaining compatibility between operating systems...
system calls and functions. However, it does not support passing arguments by reference.
Octave programs consist of a list of function calls or a script.
The syntax is matrix
Array programming
In computer science, array programming languages generalize operations on scalars to apply transparently to vectors, matrices, and higher dimensional arrays....
-based and provides various functions for matrix operations. It is not object-oriented
Object-oriented programming
Object-oriented programming is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction,...
In computer science, a data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks...
s.
Its syntax is very similar to MATLAB, and careful programming of a script will allow it to run on both Octave and MATLAB.
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....
, it may be freely changed, copied and used. The program runs under most Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
.
Command and variable name completion
Typing a TAB character on the command line causes Octave to attempt to complete variable, function, and file names (similar to Bash's tab completion). Octave uses the text before the cursor as the initial portion of the name to complete.
Command history
When running interactively, Octave saves the commands typed in an internal buffer so that they can be recalled and edited.
Data structures
Octave includes a limited amount of support for organizing data in structures. For instance:
Programming languages typically support a set of operators: operations which differ from the language's functions in calling syntax and/or argument passing mode. Common examples that differ by syntax are mathematical arithmetic operations, e.g...
are evaluated in a short-circuit fashion (like the corresponding operators in the C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....
language), in contrast to the element-by-element operators '&' and '|'.
Increment and decrement operators are unary operators that add or subtract one from their operand, respectively. They are commonly implemented in imperative programming languages...
Exception handling is a programming language construct or computer hardware mechanism designed to handle the occurrence of exceptions, special conditions that change the normal flow of program execution....
modelled after the 'unwind_protect' of Lisp. The general form of an unwind_protect block looks like this:
unwind_protect
body
unwind_protect_cleanup
cleanup
end_unwind_protect
As a general rule, GNU Octave recognizes as termination of a given 'block' either the keyword 'end' (which is compatible with the MATLAB language) or a more specific keyword 'end_block'. As a consequence, an 'unwind_protect' block can be terminated either with the keyword 'end_unwind_protect' as in the example, or with the more portable keyword 'end'.
The cleanup part of the block is always executed. In case an exception is raised by the body part, cleanup is executed immediately before propagating the exception outside the block 'unwind_protect'.
GNU Octave also supports another form of exception handling (compatible with the MATLAB language):
try
body
catch
exception_handling
end
This latter form differs from an 'unwind_protect' block in two ways. First, exception_handling is only executed when an exception is raised by body. Second, after the execution of exception_handling the exception is not propagated outside the block (unless a 'rethrow( lasterror )' statement is purposely inserted within the exception_handling code).
Variable-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 argument varargin as the last (or only) argument in the list.
function s = plus (varargin)
if (nargin0)
s = 0;
else
s = varargin{1} + plus (varargin{2:nargin});
end
end
Variable-length return lists
A function can be set up to return any number of values by using the special return value varargout. For example:
function varargout = multiassign (data)
for k=1:nargout
varargout{k} = data(:,k);
end
end
C++ integration
It is also possible to execute Octave code directly in a C++ program. For example, here is a code snippet for calling rand([10,1]):
MATLAB compatibility
Octave has been built with MATLAB
MATLAB
MATLAB is a numerical computing environment and fourth-generation programming language. Developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages,...
compatibility in mind, and shares many features with MATLAB:
Matrices as fundamental data type.
Built-in support for complex numbers.
Powerful built-in math functions and extensive function libraries.
Extensibility in the form of user-defined functions.
There are a few purposeful, albeit minor, differences:
Comment lines can be prefixed with the # character as well as the % character
Various C-based operators ++, --, +=, *=, /= are supported
Elements can be referenced without creating a new variable, e.g. [1:10](3)
Strings can be defined with the " character as well as the ' character
The following tables provide a comparison of numerical analysis software.- General :- Operating system support :The operating systems the software can run on natively .- Language features :Colors indicate features available as...
The Free Software Directory is a project of the Free Software Foundation . It catalogs free software that runs under free operating systems - particularly GNU and Linux. The project was formerly co-run by UNESCO....
A mailing list is a collection of names and addresses used by an individual or an organization to send material to multiple recipients. The term is often extended to include the people subscribed to such a list, so the group of subscribers is referred to as "the mailing list", or simply "the...
Numerical packages and libraries interfacing with GNU Octave
GNU Octave is also powered by third-party tools and libraries, mostly providing general or domain-specific abstractions for scientific computing. Those tools may be categorized according whether their contributions are more oriented toward computational modelling or toward enhancing visual analysis.
Numerical tools
Octave-forge community development page – Free software toolboxes for various problems from independent developers. A Windows installer for both GNU Octave and the toolboxes is also available.
Mastrave project – Cross-language library (GNU GPLv3+ covered) compatible with GNU Octave and Matlab, to ease environmental modelling
Scientific modelling
Scientific modelling is the process of generating abstract, conceptual, graphical and/or mathematical models. Science offers a growing collection of methods, techniques and theory about all kinds of specialized scientific modelling...
In computer science, array programming languages generalize operations on scalars to apply transparently to vectors, matrices, and higher dimensional arrays....
The MIT License is a free software license originating at the Massachusetts Institute of Technology . It is a permissive license, meaning that it permits reuse within proprietary software provided all copies of the licensed software include a copy of the MIT License terms...
Neuroimaging includes the use of various techniques to either directly or indirectly image the structure, function/pharmacology of the brain...
data within GNU Octave or Matlab, particularly functional magnetic resonance images. It also offers a Pipeline system to handle multi-stage processing.
Parallel Matlab Toolbox – Matlab language data structures and functions which implement distributed Matlab arrays. It is released under MIT license.
PLplot is a library of functions that are often used to make scientific plots in compiled languages such as C, C++, D, Fortran, Ada, OCaml and Java. PLplot can also be used interactively by interpreted languages such as Octave, Python, Perl and Tcl. The current version was written primarily by...
- License :Despite gnuplot's name, it is not part of or related to the GNU system and it is not distributed under the GNU General Public License .However, some GNU packages do use gnuplot....
in GNU Octave, licensed under the GNU LGPL.
OctPlot – High quality 2D graphics (postscript and screen graphics). Released under GNU GPL.
Octaviz – 3D visualization system for GNU Octave (wrapper that makes VTK classes accessible from within GNU Octave). It also provides high-level functions for 2D visualization. (Note: Their site says, "Unfortunately, Octaviz is no longer in development. The latest release (0.4.7) was quite usable and stable when built against vtk-5.0.")
User interfaces
Current versions of Octave do not come with a graphical user interface (GUI)/integrated development environment (IDE) by default. However, an official graphical interface based on Qt has now been migrated to the main source repository and will likely be released with Octave 4.0. Several 3rd-party graphical front-ends have been developed:
Matlab-like IDEs
GUIOctave (Windows; closed source) Under active development as of 2011.
Xoctave (Windows, Linux; GPL3) Under active development as of 2011.
Kalculus (Linux) Matlab like UI for GNU Octave and Yacas
Yacas
Yacas is a general-purpose computer algebra system. The name is an acronym for Yet Another Computer Algebra System.Released under the GNU General Public License, Yacas is free software....
Qt is a cross-platform application framework that is widely used for developing application software with a graphical user interface , and also used for developing non-GUI programs such as command-line tools and consoles for servers...
Ruby is a dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was first developed and designed by Yukihiro "Matz" Matsumoto...
Cantor is a free software mathematics application for scientific statistics and analysis. It is part of the KDE Software Compilation 4, and was introduced with the 4.4 release as part of the KDE Education Project's kdeedu package.- Features :...
(Linux, Windows; GPL2) A KDE mathematics application, with backends for R, Maxima, Octave, Scilab, Sage, KAlgebra, and Qalculate. Under active development as of 2011.
OctaveNB (Linux, Windows, OS X; GPL2) NetBeans IDE integration for GNU Octave. Last updated Apr 2009.