Numerical variables
When evaluating the value of an expression, the result is stored in a variable
called ans (answer). You can also introduce variables of your own.

Naming variables
Various programs have different rules for naming entities. Although some modern programs allow for all kind of characters in names, you may run into trouble if you use characters like "-" or blank. If you want to stay on the safe side, never having to bother about naming-rules for specific programs, follow these old-school rules:
- The first character must be an english letter :
a-z,A-Z
Some programs can handle letters like å, Æ, Ç, ü; others cannot. Use english names when programming! - The name can include numbers :
0-9 - The name can include underscore :
_
These rules apply to Octave and a number of other programs.
Assignments
When writing a=5 at the command prompt, the equal-sign should
not be thought of as a logical equality; a is not equal to 5, it
is assigned the value 5. Having that in mind, one can write assignments like
this
a=a+1
The statement above would be false if it was a logical statement, it is however not a logical statement but an assignment. The right-hand-side of the statement is calculated first, the result is then assigned to the variable on the left-hand-side.
Hiding the output and repeating previous commands
The recording below shows how to
- Write several commands at one row
- Hide the output by typing semicolon at the end of a command
- Repeat previous commands by using arrows
- Show a list of all variables by showing the Variable List
- Calculate a geometric series
Exercise
Calculate the series 
by Malin Christersson under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Sweden License