📝 Worksheet← Lesson
BitWithBite
Computational Mathematics · Quick Reference

MATLAB Basics Cheat Sheet

Computational Mathematics · Lesson 4/6
In one line: mATLAB is a specialized programming environment built specifically for numerical computing and matrix operations — long a standard tool in engineering, science, and applied mathematics.

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

Formulas

A = [1 2; 3 4] creates a 2x2 matrix
A' computes the transpose of A
inv(A) computes the inverse of A

Practice Yourself

What does 1:2:9 produce in MATLAB?
[1 3 5 7 9]
What does A' compute?
The transpose of matrix A
What function computes a matrix's inverse?
inv()