Math 260 Octave Information
You can find and download Octave here.
Command |
Purpose |
Example |
rref(A) |
Reduced row echelon form |
A = [1 2; 3 4] rref(A) |
* |
Multiply |
A = [1 2; 3 4] B = [5 6 7; 8 9 10] C = A*B |
inv(A) |
Matrix inverse |
inv(A)   OR Ainv = inv(A) |
lu(A) |
LU Factorization |
[L,U] = lu(A) |
rand(n) |
Random n x n matrix |
A = rand(3) |
det(A) |
Determinant of matrix A |
det(A) |
eye(n) |
Identity of n x n |
I3 = eye(3) |
\ |
Solve for x in Ax = b |
A = [1 2; 3 4] b = [5;6] x = A\b |
' |
Transpose |
Atranspose = A' |
cond |
Condition number (how "bad" matrix is-- 1 is best, larger is worse) |
k = cond(A) |
eig |
Eigenvalues and eigenvectors |
A = [1 2; 3 4] [V,L] = eig(A) |
qr |
QR factorization |
A = [1 2; 3 4] [Q,R] = qr(A) |
surf, etc. |
Plot 3D function |
x = linspace(-2,2,20); y = x'; z = x .* exp(-x.^2 - y.^2); surf(x,y,z)
|
|