PCA finds the orthogonal directions of greatest variance in a dataset. By projecting onto the first few principal components, we reduce dimensionality while preserving most information. It is exactly the SVD of the zero-mean data matrix.
Subtract the column mean from each column. $\bar{A}$ is a row vector of column means. In MATLAB: M = A - mean(A). This centers each variable (column) at zero.
$B$ is symmetric positive semidefinite. It is PD if $M$ is full rank. Its eigenvalues are the variances of the data along the principal directions.
The scatter matrix is just $(m-1)$ times the covariance matrix. The eigenvectors (loading vectors) are the same. The scatter matrix has the same PCA structure but is simpler to work with computationally.
The columns of $V$ from the SVD of $M$ are the PCA loading vectors (principal components). The columns of $U$, scaled by $\sigma_j$, give the score vectors.
The $j$-th score vector projects the zero-mean data onto the $j$-th loading vector. $\vec{z}_1$ captures the most variance, $\vec{z}_2$ the second most, etc. To find the first score: multiply the first left singular vector of $M$ by $\sigma_1$.
The proportion of total variance explained by the first $p$ components. Find the smallest $p$ such that $q_p \geq \theta$ (e.g. 85% or 95%). The $\sigma_j^2$ values (not $\sigma_j$) are used — this is a common mistake.
The scree plot is a visual tool for choosing the number of principal components. The cumulative explained variance plot ($q_p$ vs. $p$) directly shows you when you've exceeded a threshold $\theta$.
All three methods give the same result. The data $A$ (in $n$ dimensions) is reduced to $Z_p$ (in $p$ dimensions) where $p \ll n$.