Assuming 'dt' is a vector or a matrix in Matlab, the mean of 'dt' can be calculated using the built-in mean function as follows:
main.m23 chars2 lines
Here, we are using the (:) operator to convert the matrix into a column vector, so that mean function will calculate the average of all the elements of the matrix.
If 'dt' is a table in Matlab, we can use the mean function directly on the table to calculate the mean of each column:
main.m20 chars2 lines
gistlibby LogSnag