Linear Algebra Essentials
Linear Algebrabeginner~8 min
Solve linear systems, compute eigenvalues, and perform matrix decompositions.
Step 1 — Create and manipulate matrices
Use square brackets with semicolons for row separators.
A = [1 2 3; 4 5 6; 7 8 10]; size(A) det(A)▶ Run in SimLab
Expected output: Matrix size [3, 3] and determinant = -3
Step 2 — Solve Ax = b
solve(A, b) solves linear systems using LU decomposition. This is SimLab's equivalent of MATLAB's A\b.
A = [2 1; 5 3]; b = [4; 7]; x = solve(A, b)▶ Run in SimLab
Expected output: x = [5; -6]
Step 3 — Eigenvalues
eig(A) returns eigenvalues. Eigenvalues reveal natural frequencies, stability, and system modes.
A = [4 1; 2 3]; d = eig(A); disp(d)▶ Run in SimLab
Expected output: Eigenvalues: [5, 2]
Step 4 — SVD
Singular Value Decomposition reveals rank, condition, and principal components.
A = [1 2; 3 4; 5 6]; [U, S, V] = svd(A); disp(S)▶ Run in SimLab
Expected output: Singular values showing matrix rank
Related Tutorials
Try SimLab — Free MATLAB® Alternative
466 functions. Runs in your browser. No install.
Open SimLab