Yes. Matlab will use the available cores. At least most likely. Matlab might split the array columnwise and if the input has 5 columns, there is a chance that only 5 cores are used. Many functions are multi-threaded, but this is applied for "large" arrays only.
I'm not sure, if hyper-threading is used in Matlab. Maybe only the physical cores are used for the reason of efficiency.
matrix(i,l) = matrix(i,l)^2;
do not compute the same result. The 2nd code works for square matrices only and is a matrix multiplication. Equivalent to the first code would be:
matrix(:,:) = matrix(:,:) .^ 2;
It would be even more efficient, to omit the (:,:):