Octave: A Free, High-Level Language for Mathematics

A quick look at a language designed to manipulate matrices and provide other numerical functions.
Other Capabilities

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  2
or integrate it by:
octave:21 polyinteg(mypoly)
  ans =
  0.25000   1.00000   1.00000  -1.00000   0.00000
Note 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 = 23
If we want the roots of the polynomial, use:
octave:23 roots(mypoly)
   ans =
     -1.66236 + 0.56228i
     -1.66236 - 0.56228i
      0.32472 + 0.00000i
Note 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.

Graphics

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.

Conclusions

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.

Malcolm Murphy still wishes that he had discovered jazz before he gave up clarinet lessons at an early age. He considers himself too old (or too lazy) to start again now, so he plays the guitar instead. If you have an uncontrollable urge to send him some e-mail, his address is Malcolm.Murphy@bristol.ac.uk.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

nice thoughts

john stevenson's picture

Well, the post is actually the freshest topic on this registry related issue. jasmin live I fit in with your conclusions and will thirstily look forward to your coming updates. Just saying thanks will not just be sufficient, for the phenomenal lucidity in your writing.cameraboys.com I will right away grab your rss feed to stay abreast of any updates.

I wish our university used

James F's picture

I wish our university used this as well as I have become used to it. The interface on Octave is a lot easier to use in my opinion. Matlab will just have to do sometimes though. college grants for students

Matlab or octave

Brandschutztüren's picture

Where else could anyone get that kind of info written in such a perfect way?
Matlab or octave

best regards

my answer

andriabolton2009's picture

the best part of octave is it can parse matlab code , so it's very useful for students like me .however, matlab can not parse octave code .
another thing,you can type single quotes and double quotes in octave which like we know that's impossible with matlab(accept only singles quotes).
these are two big difference for me so I choose Octave over Matlab .
Orthopaedic Shoe Repairs

Thank you for taking the

Pramod's picture

Thank you for taking the chance to deliver this affair. I’m pleased I discovered your site on this material. I’m doing research on this interest right now and this was great. Keep up the great work.I’m doing research on this interest right now and this was great. Keep up the great work !!!!!!!!
koyun oyunları

@windows version

Ankit Sharma's picture

Octave can be used on windows using cygwin.

Very nice site. Spray

Tim's picture

Very nice site.
Spray Insulation

Didn't know that

Sean Trent's picture

Didn't know you could use it with windows. I'll check cygwin further. Thanks. S.T. repossessed cars insider tips
repossessed cars basics

Great article. It's hard to

Flash Developer's picture

Great article. It's hard to say which one is the best.

Re: Octave: A Free, High-Level Language for Mathematics

Anonymous's picture

Nice explanation, thanks. Business Marketing

Fortran is my first programming language

Warn Winch's picture

When I was young, Fortran is my first programming language. Then I learned Matlab and Octave.. but I think Matlab is easier than Octave. thanks, Pampers Diapers

disagree

Anonymous's picture

Have to disagree Octave is far more intuitive. curtains and blinds

Have used both, Octave and

online live's picture

Have used both, Octave and Matlab, but i prefer the latter, though i don't use matrixes that often. online sex cam live chat

Thanks to your article, you

Anonymous's picture

Thanks to your article, you don't know me and I live way too far away...
Why yes you can. m files work just fine with octave.

Übersetzung Spanisch Deutsch
Übersetzer Übersetzer Engisch Deutsch

Matlab's return is promising

Samt's picture

Matlab's return is promising it will help in Computer Aided Designing
Devs

There is difference between

Samt's picture

There is difference between Matlab and Octave. Octave is open source whereas Matlab is proprietary. Matlab surly is more comfortable working whereas Octave is free, that's why I love to work with Octave.
Sam

user friendly

ohio's picture

which one that give you more user friendly experience?
how to get pregnant

Doesn't this cause a conflict?

Sebski's picture

Great article but one quick question...?

"The input an' output values be optional, so it is possible t' write a function that takes no arguments an' returns no values, such as

octave:11 function hello
printf("hello\n")
endfunction"

How does this not result in conflict when compiling?

Mediation Jobs

What is my Love?

Anonymous's picture

My heart is my love
My love is my family
My family is my future
My future is my destiny
My destiny is my ambition
My ambition is my inspiration
My inspiration is my motivation
My motivation is my belief
My belief is my peace
My peace is my target
My target is heaven
My heaven is my home
My home is my eternity
My eternity is my judgment from my creator

If Tomorrow Never Comes
If I knew it would be the last time that I see you walking out of the door, I would have given you a hug and kiss and even call you back for one more.

If I knew it would be the last time I will hear your voice, I would have video taped each action and word of yours, so I could play them back day after day.

If I knew it would be the last time we would meet, I could have spared an extra minute or two to stop and say "I love you,"

If I knew it would be the last time I would be there to share your day, I could not have allowed this to slip away.

For surely there's always tomorrow to make up for an oversight, and we always get a second chance to make everything right.

The more we are still on earth living there will be always tomorrow

Send Free Texts

Send Free Texts to say good morning, good afternoon, good night, and toy I LOVE YOU

Send Free Texts Gtalk Unlimited India Calling

Octave: A Free, High-Level Language for Mathematics

nigelbiggs's picture

Yeah, I wish we had this too in our university. I imagine calculating mathematical equations in just pressing some keys in the keyboard and not solving those problems with very long solutions by hands.
computer repairs in new york

Octave: A Free, High-Level Language for Mathematics

Pehari's picture

Nice article.

First time I heard about this

Muzamil's picture

Thanks for the information octave I heard about this first time and I don have much knowledge about it, now you article has given me all the details to understand the basics about it will learn more thanks.

???????? ?????: ???????? ???

peter murphy's picture

???????? ?????: ???????? ??? ???? ? ????????? ???????? ?? ? ???? ???????: ??? ????? ???? ????? ???? ??????? ?????????.
play blackjack safe online casino online bonus slots

thank you

Anonymous's picture

thnaks for shared ßß Our website is: http://www.cilekerotik.com

Wow...

Musikproduzent's picture

Wow!I am pretty new to learn about this but would like to know which one in the end is the way to go?Is it Matlab or octave?I've read that Matlab can be more powerful, is that correct?
Musikproduzent im Tonstudio

I have been learning computer

Nancy's picture

I have been learning computer languages but never even heard about Octave. May be because it is old now and isnt used much but it is always interesting to know more. I will be digging in deep to find more information on this. electric meat slicer

That's all we need :)

seo packages's picture

That's all we need, another high-level Maths language. I find C difficult enough to deal with. My Dad was right, should have done law rather than engineering :)

which one?

Travis Elliott's picture

So in the end which one is the way to go? Matlab or octave? Both have benefits
Hearing Loss Treatment

I agree with David

Anonymous's picture

I totally agree with David that it's almost mandatory that you also install the octave-forge package...

Backlink Software

Octave is great

Mathew Trujillo's picture

"I'd say there's a *big* difference between Matlab and Octave. Octave is Open Source, that means it's free as opposed to Matlab which you have to pay for. Very powerful."

Absolutely agree with this. I love Matlab but the flexibility that I have with Octave is awesome.

article submission service

Octave VS Matlab - Big Difference

Frank Bosco's picture

I'd say there's a *big* difference between Matlab and Octave. Octave is Open Source, that means it's free as opposed to Matlab which you have to pay for. Very powerful.

Coding Style

Terry Galarneau's picture

I see about the Visual Basic notation like if .. else .. end, but Octave, like Matlab uses C oriented notations also, for example a ! in Octave is a NOT, as it is in C, instead of <> in VB. Also you can use all the C based = symbols like: `+=', `-=', `*=', `/=', `^=', `.*=', `./=', and `.^='.

Octave Origins

Terry Galarneau's picture

From what I'm getting, James B. Rawlings and John W. Eaton at the University of Texas were the first to start development of Octave, clear back in 1988. In '92 James Rawlings started development full time. How does open source software put food on the table. I'm still puzzled.

Almost VB Style

Rick Cole's picture

This is my first introduction to either Matlab or Octave. The format almost has a Visual Basic feel to it; not like C at all. Then again, maybe just the function definitions. For me, the advantage would be to do server side math, thereby not relying on flaky client side Javascript, which is anything but precision.

Octave is no doubt an equally

Jacob's picture

Octave is no doubt an equally impressive piece of software and just as functional as Matlab. I've used both and have no preference either way as they both work in very similar manners. There is no doubt that Octave is a great alternative to Matlab and gets the job done just as well. backpacking Europe

Newest Octave Release

Fran Callahan's picture

As of August 1, 2010 the newest version 3.3.52 is available in BETA for people interested in helping test. Be sure to download it and give it a spin: Octave Downloads.

Windows Version

Jason Becker's picture

MatLab is indeed a great high level program (language?) for doing precision math. It's available for Windows or Linux. I didn't see if Octave is also available for both.

mathlab is still better

johnnycwn's picture

I have used both programs and I think mathlab is still much than octave.
adjustable dumbbells

I am starting to learn about

John Sweeney's picture

I am starting to learn about this but would like to know that this will be used for quite some time down the road. I see this is dated 1997, has there been any changes to this, or is there any news of switching to a different system? custom t-shirts

Changes

John Palmer's picture

I see this is dated 1997, has there been any changes to this, or is there any news of switching to a different system? I am starting to learn about this but would like to know that this will be used for quite some time down the road. Outdoor Pool Furniture

I admire the valuable

sipu1234's picture

I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else! Colorado Personal Injury

You don't know me and I live

Boota's picture

You don't know me and I live way too far away... but my name is Peter. I'm doing an undergrad I.T. degree and this semester I'm doing a subject on Pattern Recognition (eventually using Neural Networks). The subject demands use of Matlab and for some reason, our I.T. faculty seems to be fairly poor at supporting anything Linux (except for network admin and programming based subjects). iphone headphones

Matlab OR Octave

Jean.B's picture

the best part of octave is it can parse matlab code , so it's very useful for students like me .however, matlab can not parse octave code .
another thing,you can type single quotes and double quotes in octave which like we know that's impossible with matlab(accept only singles quotes).
these are two big difference for me so I choose Octave over Matlab .
router wireless reviews

I tried Octave

Router compare's picture

I tried Octave once , it's unbelievable .
very very useful for people who use Matrix (resolve Jordan and Gauss problem easily)

I wish our university had

Jerry Bloomberg's picture

I wish our university had Octave installed. But most machines in Ottawa are Windows.

I wish we had it too

Rikki's picture

Yeah, I wish we had this too in our university. I imagine calculating mathematical equations in just pressing some keys in the keyboard and not solving those problems with very long solutions by hands.

Rikki
Link Building Service

Great

kiran1234's picture

Thank you for such a fantastic blog. Where else could anyone get that kind of info written in such a perfect way? I have a presentation that I am presently working on, and I have been on the look out for such information. Local Marketing

You have a lot of resources

betito's picture

You have many resources on this page.
I always consult linuxjournal so many things about my job, and my school.

If you need more info, send me an email.
Betito
Link Building Service

What I like!

glass top dining table's picture

I like how it provides a convenient command line interface for solving linear and nonlinear problems numerically! Also great features are: Matrices as fundamental data type and Built-in support for complex numbers.

Thank you!

jayeola's picture

I used Matlab exclusively in my MSc. never knew that there was a Gnu'able version. Installed from my GNU/Linux's distrobution and taking it for a spin. Thanks :-)

jayeola

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState