I generated random values using following function :
P = floor(6*rand(1,30)+1)
Then, using T=find(P==5)
, I got values where outcome is 5
and stored them in T
. The output was :
T =
10 11 13 14 15 29
Now, I want to calculate the mean value of T
using mean(T)
but it gives me following error :
error: mean(29): out of bound 1 (dimensions are 1x1) (note: variable 'mean' shadows function)
What I am trying to do is to model the outcomes of a rolling a fair dice and counting the first time I get a 5 in outcomes. Then I want to take mean value of all those times.