Professional Documents
Culture Documents
GNU Octave
From Wikipedia, the free encyclopedia
Contents
1 History
2 Technical details
3 Octave, the language
4 Notable features
5 MATLAB compatibility
6 See also
7 External links
7.1 Documentation
7.2 Graphical User Interfaces
7.3 Web Interfaces
7.4 Add-ons
8 References GNU Octave
Developed John
C++
W. Eaton
Written
History by
in
Initial 1988
The project was conceived around 1988. At Platform Cross-platform
release
first it was intended to be a companion to a Available ?
chemical reactor design course. Real Stable 3.0.3 (http://en.wikipedia.org/w/index.php?
in
development was started by John W. Eaton release title=Template:Latest_stable_software_release/GNU_Octave&action=edit) (October 10,
in 1992. The first alpha release dates back to Type Scientific
2008) computing
[+/− (http://en.wikipedia.org/w/index.php?
January 4, 1993 and on February 17, 1994 License GNU General Public License
title=Template:Latest stable software release/GNU Octave&action=edit&preload=Template:LSR/syntax)]
version 1.0 was released. Version 3.0 was Preview 3.0.1 (http://en.wikipedia.org/w/index.php?
released on December 21, 2007. Website http://www.gnu.org/software/octave/
release title=Template:Latest_preview_software_release/GNU_Octave&action=edit) (April 21,
file://C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\CSR2P3NS.htm 12/26/2008
Page 2 of 6
Technical details
Octave is written in C++ using STL
libraries.
Octave uses an interpreter to execute
the Octave language.
Octave is extensible using dynamically loadable modules.
Octave interpreter works in tandem with gnuplot and Grace software to create plots, graphs, and charts, and to save or print them.
Octave programs consist of a list of function calls or a script. The syntax is matrix-based and provides various functions for matrix operations.
It is not object-oriented, but it does support various 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.
Notable features
Command and variable name completion
file://C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\CSR2P3NS.htm 12/26/2008
Page 3 of 6
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:
1 2
3 4
octave:4> x.c
x.c = string
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 `|'.
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:
file://C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\CSR2P3NS.htm 12/26/2008
Page 4 of 6
unwind_protect
body
unwind_protect_cleanup
cleanup
end_unwind_protect
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.
A function can be set up to return any number of values by using the special return value varargout. For example:
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([9000,1]):
#include <octave/oct.h>
...
ColumnVector NumRands(2);
NumRands(0) = 9000;
NumRands(1) = 1;
octave_value_list f_arg, f_ret;
file://C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\CSR2P3NS.htm 12/26/2008
Page 5 of 6
f_arg(0) = octave_value(NumRands);
f_ret = feval("rand",f_arg,1);
Matrix unis(f_ret(0).matrix_value());
MATLAB compatibility
Octave has been built with MATLAB compatibility in mind. It therefore shares many features with MATLAB:
See also
List of numerical analysis software
Comparison of numerical analysis software Free software portal
External links
Octave.org (http://www.gnu.org/software/octave/) Home Page
Documentation
QtOctave Graphical User Interface (http://qtoctave.wordpress.com/what-is-qtoctave/) - Matlab counterpart. Under heavy Development.
Octave Workshop: an Octave IDE (http://www.unige.ch/math/folks/loisel/www.math.mcgill.ca/loisel/octave-workshop/) - Development
stopped in 2006
file://C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\CSR2P3NS.htm 12/26/2008
Page 6 of 6
kOctave: Graphical User Interface (http://athlone.ath.cx/~matti/kde/koctave/) - for the KDE Desktop (base for Octave Workshop)
Development stopped in 2003
Web Interfaces
Add-ons
Octave-forge community development page (http://octave.sourceforge.net/) - Toolboxes for various problems from independent
developers.
OctPlot (http://octplot.sourceforge.net/) - High quality 2D graphics.
Octave graphics add-on (http://www.grafickenadstavbyoctave.wz.cz/) - 3D visualization system for Octave.
Octaviz (http://octaviz.sourceforge.net/) - 3D visualization system for Octave.
MPI Toolbox for Octave (MPITB) (http://atc.ugr.es/javier-bin/mpitb) - Parallel Computing for Octave using MPI.
References
1. ^ Eaton, John. "About Octave (http://www.gnu.org/software/octave/about.html)". Retrieved on 2008-10-14.
file://C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\CSR2P3NS.htm 12/26/2008