Created
November 29, 2011 15:38
-
-
Save mattnworb/1405216 to your computer and use it in GitHub Desktop.
error in Octave using mean on binary vector
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
octave-3.4.0:1> a = [ 1 2 3 4] | |
a = | |
1 2 3 4 | |
octave-3.4.0:2> mean(a) | |
ans = 2.5000 | |
octave-3.4.0:3> b = (a == 2) | |
b = | |
0 1 0 0 | |
octave-3.4.0:4> mean(b) | |
error: mean: X must be a numeric vector or matrix | |
error: called from: | |
error: /Applications/Octave.app/Contents/Resources/share/octave/3.4.0/m/statistics/base/mean.m at line 69, column 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment