Do you understand indexing? Perhaps you really need to start with a tutorial, the Onramp tutorials may be a good place to start.
If A is a matrix,
then you can index into the matrix. A colon as an index tells MATLAB to take all of the elements in that row or column, etc.
So A(3,:) extracts the 3rd row, with all of the elements in that row.
But all matrices in MATLAB can also be viewed as higher dimensional matrices. So a 5x5 matrix, is also a 5x5x1 matrix. So this:
does exactly the same thing. Or, we might have a matrix with multiple true planes in that matrix.
So that matrix now has 2 planes, EACH of which is a 3x4 matrix. Now
That extracted the third column, of the 2nd plane of the matrix. The result is 3x1 vector.