hist() unable to handle an int8 vector? (UNCLASSIFIED)

Jankowski, Nicholas (Civ, ARL/SEDD) nicholas.jankowski at us.army.mil
Mon May 5 10:50:29 CDT 2008


Classification:  UNCLASSIFIED 
Caveats: NONE

Was trying to generate a histogram plot of a vector using the hist()
function.  

This works
testvector = [1 2 3 1 2 3 4 1 ];
hist(testvector);

Produces the bar plot binned as expected

This, on the other hand, doesn't:

testvector = uint8([1 2 3 1 2 3 4 1]);
hist(testvector);

Get the following output:

error: binary operator `*' not implemented for `matrix' by `uint8
scalar' operations
error: evaluating binary operator `*' near line 69, column 11
error: evaluating binary operator `+' near line 69, column 33
error: evaluating assignment expression near line 69, column 7
error: evaluating if command near line 66, column 3
error: called from `hist' in file `C:\Program
Files\Octave\share\octave\3.0.0\m\plot\hist.m'

Same result for int8, int16, etc.  (anything except single or double)

To make my actual program work, I had to cast it as:
hist(double(myvector))

Running Win32, precompiled Octave3.0.0, octave-forge, statistics-1.0.6

Is there any reason a hist function shouldn't work for an array of ints?



Classification:  UNCLASSIFIED 
Caveats: NONE




More information about the Bug-octave mailing list