Key Ideas
1MATLAB's Core Idea. Everything in MATLAB is treated as a matrix (even a single number is a 1x1 matrix), making it especially natural for linear algebra and numerical work.
2Creating Matrices. Matrices are created with square brackets, semicolons separating rows: A = [1 2; 3 4] creates a 2x2 matrix.
3Basic Matrix Operations. A + B and A * B work directly on matrices; A' computes the transpose; inv(A) computes the inverse.
4Vectors and Ranges. A range like 1:5 creates the vector [1 2 3 4 5]; 1:2:10 creates [1 3 5 7 9], stepping by 2.
5Built-in Functions. MATLAB includes many built-in mathematical functions like sqrt(), sin(), det(), and eig() (for eigenvalues), applied directly to matrices.
Worked Examples
In MATLAB, what does the command 1:5 produce?
[1 2 3 4 5]
In MATLAB, what does A' do if A = [1 2; 3 4]?
[1 3; 2 4]
In MATLAB, what does det(A) return for A = [2 0; 0 3]?
6