[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #33523] Matlab compatibility issue with averag

From: Fred
Subject: [Octave-bug-tracker] [bug #33523] Matlab compatibility issue with averaging the 3rd dim of a 2-D array
Date: Mon, 27 Aug 2012 18:04:17 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:12.0) Gecko/20100101 Firefox/12.0

Follow-up Comment #17, bug #33523 (project octave):

I have come across the same issue using octave recently (which I just switched
to). I completely agree with John's comment. In my example, I need to take the
mean of the 3rd dimension, but only in some arbitrary range (1:2 for instance)
which can happen to be singleton.

>> a = zeros(3,4,5); k=1:2;
>> mean(a(:,:,k),3)
ans =

        0        0        0        0
        0        0        0        0
        0        0        0        0

If the range appears to be singleton, it bugs:

>> k=1:1;
>> mean(a(:,:,k),3)
error: mean: DIM must be an integer and a valid dimension
error: called from:
error:   /usr/share/octave/3.4.2/m/statistics/base/mean.m at line 111, column

Strangely, I do not get a bug when doing the same thing on the second

>> mean(a(:,k,k),2)
ans =


This is due to the second dimension singleton being not removed. It does not
look coherent to me.

Is there any plan to get this corrected?


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]