bugGNU Octave - Bugs: bug #56152, Feature Request: all function...

 
 

bug #56152: Feature Request: all function should support "all" argument for Matlab compatibility

Submitter:  None
Submitted:  Wed 17 Apr 2019 04:19:51 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Confirmed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 17 Apr 2019 04:57:21 PM UTC, comment #1: 

Matlab's own documentation says


B = any(A,'all') tests over all elements of A. This syntax is valid for MATLABĀ® versions R2018b and later.


This is a very, very new addition to Matlab and it is unsurprising that Octave does not implement it yet.

I've changed this report to be a feature request for the development branch of Octave.

In the mean time, this code is equivalent and will work in Octave or in Matlab versions before 2018b


B = any (A(:))


This code idiom of turning an ND-array in to a column vector is very common and I don't think it hurts code readability.

Rik <rik5>
Group administrator
Wed 17 Apr 2019 04:19:51 PM UTC, original submission:  

The following is valid MatLab code (2018b)


a = reshape(1:36, 6, 6);
any(a>5, 'all')
all(a>5, 'all')


with result 1 (true).
In octave 4.0.3 i get the error


error: invalid conversion from string to real scalar
error: octave_base_value::int_value (): wrong type argument 'sq_string'
error: all: expecting dimension argument to be an integer


Differences between octave and matlab are considered a bug (at least according to wikipedia), and as both the FAQ (https://wiki.octave.org/FAQ#Differences_between_Octave_and_Matlab) and the trouble section of the documentation (https://octave.org/doc/interpreter/Trouble.html#Trouble) do not mention this as an exception, I would think so too.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-04-17 rik5 Item GroupMatlab Compatibility Feature Request
        StatusNone Confirmed
        Release4.0.3 dev
        SummaryArgument 'all' for functions any and all not available Feature Request: all function should support "all" argument for Matlab compatibility

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code