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

 
 

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

Submitted by:  None
Submitted on:  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

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

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>
Project 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)
  •  

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

    Only project 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.5