octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #61098] Function `size` changed in Matlab R201


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #61098] Function `size` changed in Matlab R2019b
Date: Wed, 1 Sep 2021 01:35:15 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?61098>

                 Summary: Function `size` changed in Matlab R2019b
                 Project: GNU Octave
            Submitted by: siko1056
            Submitted on: Wed 01 Sep 2021 02:35:13 PM JST
                Category: Octave Function
                Severity: 4 - Important
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: Confirmed
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: Any

    _______________________________________________________

Details:

The `size` function can be called in new ways since Matlab R2019b:

> Starting in R2019b, you can also specify dim as a vector of positive
integers to query multiple dimension lengths at a time. For example, size(A,[2
3]) returns the lengths of the second and third dimensions of A in the 1-by-2
row vector szdim.

https://www.mathworks.com/help/matlab/ref/size.html


sz = size(A)
szdim = size(A,dim)
szdim = size(A,dim1,dim2,…,dimN)
[sz1,...,szN] = size(___)


This change seems reasonable to me and mostly backward compatible.

Non-existing dimensions get filled up with "1"s, as the example illustates:


>> A = eye (3);
>> size (A, 4,2,3,1)

ans =

     1     3     1     3

>> size (A, [4,2,3,1])

ans =

     1     3     1     3


However this is a very elementary function and Octave should adapt soon.





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61098>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]