Octave
Crash course
1. Install
2. Type octave in your terminal. You'll see the command prompt octave:n>.
3. Octave code is saved in plain text files, typically with a
.m
extension
4. End a command with a semicolon ; to execute it without displaying the results immediately
5. # single line comment, % comment
6. help plot - get the docs for plot function
7. exit or quit for exit
8. Variables are case sensitive
x = 10; ( output suppressed)
y = x + 5 ( result displayed)
9. Basic math + - * / ^
10. Build in constants : pi, e, I (j ) for imaginary unit
11. Vectors and matrices : almost everything is a matrix
11.1 Row vector v_row = [1 2 3 4]
11.2 Column vector v_col = [1; 2; 3; 4]
11.3 Matrix M = [1 2 3; 4 5 6; 7 8 9]
11.4 Sequences 1:5 >> creates [1 2 3 4 5]
1:2:10 (start:step:end) >> creates [1 3 5 7 9]
11.5 Special matrices
zeroes(m, n) >> m x n matrix with zeroes
ones(m, n) >> m x n matrix with ones
eye(n) >> creates n x n identity matrix