Getting Started

Run Octave App

You can run Octave App by double-clicking on the Octave icon (graphical user interface, GUI) in Windows desktop (for Windows users) or in Application menu (for Mac users).

GNU Octave: Getting Started

Run First Octave Command

In command windows, you can see “>>”, so called as command prompt, followed by a blinking cursor right after it, meaning it waits for your inputs.

>>

To run the very first Octave command, you can click the left-mouse button where the blinking cursor is, and then type “1+2” followed by the enter key to run the command. Matlab/Octave should return something like

>> 1+2
ans = 3

It means that Octave calculate the algebraic expression 1 + 2 and returns 3 and save it under a variable (virtual storage space) “ans”. Note the most recent answer will be automatically saved in a variable “ans”, and the value of the variable “ans” will be replaced with the result of the most recent command as you run an additional command. For example, if you run 2 + 3, the “ans” will be replaced with 5.

To call most recent result, type “ans” in the command window

>> ans
ans = 3

Clear Command Window

To wipe out the results and texts in the command window, type “clc”.

>> clc 

It will clear out the command window.

“help” Command

Online manual is available for Octave, and you can have an access by typing “help” to see the long list of all available commands in Octave.

>> help

You can find detailed instruction for a specific command, for example, cosine function can be found by typing “help cos”, i.e., “help” followed by the command.

>> help cos

This will show brief descriptions about the cosine function including a syntax, example runs, and other related functions/commands.

“lookfor” Command

“help” command is useful as long as you know the exact Octave command name. So, we cannot use “help” command if you do not know the exact command name. To search available Octave command, you can use “lookfor” followed by the key word that you would like to search under. For example, if you want to search “cos” as a key word, you can type

>> lookfor cos

It will list all available Octave command having “cos” as a key word.

In this article

Scroll to Top