How to use the interactive environment in Octave
When you open Octave, the software automatically opens an interactive session.
The Octave command prompt appears on the screen
>>
Octave waits for you to type something.
For example, type the operation 2 + 3 and hit enter
>> 2+3
Octave receives and processes the command.
Then it displays the result.
ans = 5
The term ans is the abbreviation for answer.
The interactive environment allows you to use Octave as a calculator.
Note. The command line is also called REPL ( Read Eval Print Loop ). This acronym tells you what happens when you type a command. Octave reads it (R), evaluates it (E), prints (P) the result and goes back in the loop (L).
Octave keeps in memory the history of the commands you have already typed.
You can see past commands by pressing the up and down arrow keys on the keyboard.
This way you can also reuse them without having to rewrite them.
If you don't remember a command, type the first few letters and then press the tab key.
For example, type cos and then press the key TAB
>> cos
cos cosd cosh
Octave shows you all the commands starting with these letters: cos, cosd e cosh.
For more information on using a command, type the instruction help followed by the command name
For example, type help cos
help cos
Octave displays a short description about the cos function.
For more information on the command, type the instruction doc followed by the name of the command.
For example, type doc cos
doc cos
The instruction doc opens the Octave documentation and also gives you some practical examples of using the command.