Functions and 2-D Arrays
Functions like sqrt, sin, cos that operate element-by-element on 1-D arrays work the same on 2-D arrays.
Functions like sum, prod that produce a scalar result from a 1-D array produce a 1-D array result when applied to a 2-D array. The function is applied to columns of the 2-D array.
a = [1 2 3; 4 5 6; 7 8 9; 10 11 12]
To apply these functions to rows in a 2-D array, transpose the array with the quote operator.