Hello I am new to programming in Matlab and am attempting to find the number of data points within a set of data that are x standard deviations away from the mean. The dataset is 5,000 random numbers using randn. I would like to do this with a loop, and I think the steps are should take are as follows:
- Have a loop go through the 5,000 random data points
- Count the points that are +- 1 std from the mean
- Print the number of points
I am not really sure where to begin and if someone could point me in the right direction it would be greatly appreciated. Thanks.
a
are betweenlim1
andlim2
:sum(a>=lim1 & a<=lim2)
. Now adapt that to an array, with mean and standard deviation. – user2271770std
– Daniel