Reference: http://www.cnblogs.com/linkr/articles/2297783.html
1. Mean value
Mathematical definition: An average is a measure of the trend in a set of data , which is the sum of all the data in a set of data divided by the number of this set of data. It is an indicator that reflects trends in the data set.
matlab function: Mean
>>x=[1,2,3]
>>mean (x) =2
If x is a matrix, its mean value is a vector group. Mean (x,1) is the mean of the column vector, and mean (x,2) is the mean of the row vector.
>>x=[1 2 3; 4 5 6]
>>mean (x,1) =[2.5 3.5 4.5]
>>mean (x,2) =2
5
Mean (mean (X)) if the mean of the entire matrix is required
>>mean (Mean (X)) =3.5
You can also use the MEAN2 function:
>>mean2 (X) =3.5
2. Variance
Mathematical definition: variance (Variance) is used to measure random variables and their mathematical expectations (i.e. mean values Degree of deviation.
Mean variance:
matlab function: var
>> y=[1 2 3 4]
>> var (Y) =1.6667
>> var (y,1) =1.25
Description: Var (y,0) Denominator is N-1,var (y,1) denominator is n
The above is the variance of the vector, the variance of the matrix is obtained.
>> var (X (:), 1) =2.9167
You can also use the standard deviation to find the variance, STD2 to find the standard deviation of the matrix
>>STD2 (x) *std2 (x) *5/6=2.9167% (std2 default is N-1)
Another use of standard deviation STD usage with Var
Matlab to calculate variance, mean value