Octave: A Free, High-Level Language for Mathematics
Although Octave has very strong matrix capabilities, it has many other features as well. For example, it has routines to manipulate polynomials. A polynomial is entered as a vector of coefficients; so, for example, the polynomial x3+3x2+2x-1 can be represented by the vector:
octave:19 mypoly=[1 3 2 -1] mypoly = 1 3 2 -1
We can then differentiate mypoly using the command:
octave:20 polyderiv(mypoly) ans = 3 6 2or integrate it by:
octave:21 polyinteg(mypoly) ans = 0.25000 1.00000 1.00000 -1.00000 0.00000Note that Octave uses zero as the constant of integration. We can also evaluate the polynomial at a given value; thus, to find the value of mypoly(2) use the command:
octave:22 polyval(mypoly,2) ans = 23If we want the roots of the polynomial, use:
octave:23 roots(mypoly) ans = -1.66236 + 0.56228i -1.66236 - 0.56228i 0.32472 + 0.00000iNote that Octave is quite happy with complex numbers, even though all the examples I've given have been real. There are also routines to convolve and deconvolve polynomials, form companion matrices and characteristic polynomials, and form a partial fraction representation of the quotient of two matrices.
Other features include functions to solve systems of nonlinear equations, solve differential and differential-algebraic equations, perform quadrature and collocation, as well as statistics, control theory, signal processing, image processing and optimization routines. The manual indicates areas where the developers hope to extend Octave's capabilities.
Octave provides graphics capabilities via the Gnuplot program, which has to be obtained separately. The advantage of this is that Octave supports all the output devices Gnuplot supports, including the Linux terminal, which might be of interest if you have a low-memory system.
Octave provides two low-level graphics functions, gplot and gsplot, that behave almost exactly like the Gnuplot functions plot and splot, and also provides several higher-level plotting functions based on the graphics functions found in Matlab 3.5. Two and three-dimensional plotting commands are also available.
If you are familiar with Gnuplot, then you will probably appreciate the flexibility offered by access to Gnuplot's commands. However, the higher-level commands offered by Octave are very easy to use and you may find you don't have to use the Gnuplot commands at all.
Octave is a flexible, powerful, easy-to-use, high-level language designed for numerical computations. It comes with a very readable 200+ page user manual, and a help system based around the GNU info system. The main advantage of a high-level language over a language like FORTRAN is that development time is usually considerably shorter using a high-level language. This allows for easy prototyping and experimentation.
Although the documentation doesn't claim that Octave is intended to be a Matlab clone, or Matlab compatible, Octave is probably the most Matlab-like of the freely available high level languages. It's not exactly the same, but I was able to convert a suite of Matlab m-files that perform finite element analysis of the Navier-Stokes equations to Octave very easily.
Octave has many more features than I have described here, but I've provided an overview of its main strengths. If you're looking for a language for numerical work, Octave is certainly an option. I don't think you can directly compare Octave with such languages as RLaB, SciLab and Yorick—they all do different things, and which you choose depends on what you want to do as well as personal preference. My preference is Octave.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Devuan Beta Release
- May 2016 Issue of Linux Journal
- EnterpriseDB's EDB Postgres Advanced Server and EDB Postgres Enterprise Manager
- The US Government and Open-Source Software
- The Humble Hacker?
- The Death of RoboVM
- BitTorrent Inc.'s Sync
- Open-Source Project Secretly Funded by CIA
- New Container Image Standard Promises More Portable Apps
- AdaCore's SPARK Pro
In modern computer systems, privacy and security are mandatory. However, connections from the outside over public networks automatically imply risks. One easily available solution to avoid eavesdroppers’ attempts is SSH. But, its wide adoption during the past 21 years has made it a target for attackers, so hardening your system properly is a must.
Additionally, in highly regulated markets, you must comply with specific operational requirements, proving that you conform to standards and even that you have included new mandatory authentication methods, such as two-factor authentication. In this ebook, I discuss SSH and how to configure and manage it to guarantee that your network is safe, your data is secure and that you comply with relevant regulations.Get the Guide