blob: 53849a465c1abd42c51533aa8186d890d2e5eec7 (
plain)
1
2
3
4
5
6
7
8
|
//A function to compute standard deviation of a given data
//Input: Data (a vector) and mean of the data as input
//Output: standard deviation of the data
function standard_dev = mystdev(data,mean_of_data)
temp = (data - mean_of_data*ones(length(data)))^2;
standard_dev = sqrt(sum(temp)/(length(data)-1));
endfunction
|