function mean

Diana Fries diana.fries at gmx.net
Thu Apr 2 18:52:55 CDT 2009


Hi,


I found a difference between between Octave and Matlab.
My Octave version is 3.0.1.

In the function 'mean' it is not possible to calculate the mean of a 
complex matrix with Octave, in Matlab it is possible.

Example code:
a=[j,1,1+j];
mean(a);

In Matlab the result is 0.6667+0.6667i.

In Octave the following error message is displayed.
error: octave_base_value::array_value(): wrong type argument `complex
matrix'
error: sumskipnan: first input argument must be a real matrix
error: evaluating if command near line 72, column 1
error: called from `mean' in file 
`/usr/share/octave/packages/nan-1.0.6/mean.m'



Regards
Diana


More information about the Bug-octave mailing list