[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #43038] 'mean' fails when operating on trailin
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #43038] 'mean' fails when operating on trailing singleton dimension |
Date: |
Thu, 21 Aug 2014 02:41:35 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36 |
URL:
<http://savannah.gnu.org/bugs/?43038>
Summary: 'mean' fails when operating on trailing singleton
dimension
Project: GNU Octave
Submitted by: None
Submitted on: Thu 21 Aug 2014 02:41:34 UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Feature Request
Status: None
Assigned to: None
Originator Name: Pierre Bellec
Originator Email: address@hidden
Open/Closed: Open
Discussion Lock: Any
Release: 3.8.1
Operating System: GNU/Linux
_______________________________________________________
Details:
Dear Octave developers,
Thanks a million for the fantastic software. I just ran across the following
error:
>> a = rand(2,2,1);
>> mean(a,3);
error: mean: DIM must be an integer and a valid dimension
error: called from:
error: /usr/share/octave/3.8.1/m/statistics/base/mean.m at line 107, column
7
What happens is that the trailing singleton dimension is removed, and the
variable 'a' has only two dimensions, so the error message is in essence
correct.
However, this is causing trouble in the code I am currently working on: in my
code, in general the third dimension is not a singleton, and the code works
fine. But if the third dimension happens to be a singleton (in my case, it
codes for the number of parameters I am testing in a simulation), I get an
error. I would find it logical for mean(a,3) to return a, instead of an error.
Actually, this behaviour would make sense for mean(a,n), with n greater than
the number of dimensions of a.
What do you think ? Am I missing a potential issue with the suggested
behaviour ?
Best,
Pierre
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?43038>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #43038] 'mean' fails when operating on trailing singleton dimension,
anonymous <=