bugGNU Octave - Bugs: bug #50884, isfigure([]) = []

 
 

bug #50884: isfigure([]) = []

Submitted by:  Muhali <muhali>
Submitted on:  Wed 26 Apr 2017 03:32:19 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: Works For MeAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 27 Apr 2017 03:33:03 PM UTC, comment #5:

Okay. So the current behavior is the desired behavior. Closing report.

Rik <rik5>
Project Administrator
Thu 27 Apr 2017 03:01:38 PM UTC, comment #4:

To me this still looks like it's working correctly. Since isfigure and isaxes are more specific versions of ishandle, I would expect them to work similarly. The ishandle Matlab function returns an array that is the same size as the input array. So does the newer Matlab function isgraphics. So do the Octave functions isaxes and isfigure.

Mike Miller <mtmiller>
Project Administrator
Wed 26 Apr 2017 05:07:56 PM UTC, comment #3:

Since isfigure() is an Octave-only feature, would it be useful to make a special case for isfigure and isaxes to return true/false for the empty case?

For programming, I try and follow the principle of Least Surprise. In this case, since an empty matrix is not a figure, I would expect it to return false.

But, Octave might already be relying on the current behavior.

Rik <rik5>
Project Administrator
Wed 26 Apr 2017 04:21:22 PM UTC, comment #2:

To the second question, an empty double array is still numeric. An empty char array is not.

IOW the dimensions of the array have nothing to do with whether it is numeric or a struct or real or complex, those properties apply to the entire array.

However each individual member of an array may be finite or infinite or may refer to a graphics handle or not.

Mike Miller <mtmiller>
Project Administrator
Wed 26 Apr 2017 04:19:05 PM UTC, comment #1:

Well isnumeric, isstruct, isreal, iscomplex, etc, all test the properties of an entire array and return a single logical value.

The Matlab function ishandle, and the Octave extensions isaxes and isfigure, operate elementwise on the given array, so they return an array with the same dimensions as the input array. This is more comparable to the isfinite or isinf functions than isnumeric.

Think of isaxes, isfigure, and ishandle more like

Mike Miller <mtmiller>
Project Administrator
Wed 26 Apr 2017 03:32:19 PM UTC, original submission:

Whereas isnumeric, isstruct, etc. return truth values for all arguments, we have

isfigure([]) = []

Is that on purpose? - Besides, why do we have

isnumeric([]) = 1 ?

Muhali <muhali>

 

(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 rik5 (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by muhali (Submitted the item)
  •  

    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
    Thu 27 Apr 2017 03:33:03 PM UTCrik5Open/ClosedOpen=>Closed
    Wed 26 Apr 2017 04:19:05 PM UTCmtmillerStatusNone=>Works For Me

    Back to the top


    Powered by Savane 3.1-cleanup1