bugGNU Octave - Bugs: bug #49019, some function fail when DIM>=3...

 
 

bug #49019: some function fail when DIM>=3 and size(X,DIM)==1

Submitted by:  None
Submitted on:  Wed 07 Sep 2016 08:55:53 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: InvalidAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 4.0.3
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 04 Nov 2016 02:32:14 AM UTC, comment #3:

It looks like some of this has been resolved in the source (I'm running 4.0.0) with the closing of #33523. However the "fft" function still seems to be incompatible with the MATLAB version.

Joakim Andén <janden>
Thu 03 Nov 2016 10:44:46 PM UTC, comment #2:

Looking at the MATLAB behavior for these functions

so identity for "fft" and "mean", while empty matrix for "diff". However, Octave gives errors for each of those calls. Similar discrepancies are there for "mode", "median", and others. For the sake of compatibility, it would be good to copy this behavior. I would be willing to make the necessary changes if there is interest in changing this.

Joakim Andén <janden>
Wed 07 Sep 2016 03:00:36 PM UTC, comment #1:

If a function accepts a dimension greater than ndims, then it is probably done for Matlab compatibility.

Indeed, for example, Matlab's help for the max function states

> max returns A if dim is greater than ndims(A).


This is not the case for most functions and cannot really be solved in a general way. Since all arrays have ndims >= 2, 1 and 2 will always work, but dim >= 3 will only work if the array actually has ndims >= dim.

Mike Miller <mtmiller>
Project Administrator
Wed 07 Sep 2016 08:55:53 AM UTC, original submission:

When DIM>=3 and size(X,DIM)==1, some functions work, such as "max", "min", "sum", "prod",

but some functions fail, such as "fft", "mean", "diff",

I'm not sure whether this is a bug or a feature,

although sometimes this is inconvenient and we have to make a workaround by "resize" or "postpad" X to make sure size(X,DIM)>=2 before calling these functions.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by janden (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 07 Sep 2016 03:00:36 PM UTCmtmillerStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1