This is not a bug. Please read the documentation, if you have a problem with a command:
The 2nd argument of mean must be the dimension to operate on. Then a floating point number between 0 and 1 will not work. See:
a = magic(3)
mean(a, 1)
mean(a, 2)
You forgot to mention, what you want to calculate. Maybe you mean:
a = rand(100, 1);
mean(a([4,6]))
mean(a(4:6))
1 Comment
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/372711-bug-with-mean-on-floating-point-vector-elements#comment_515720
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/372711-bug-with-mean-on-floating-point-vector-elements#comment_515720
Sign in to comment.