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

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

[Octave-bug-tracker] [bug #43698] ismatrix not Matlab compatible


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #43698] ismatrix not Matlab compatible
Date: Tue, 25 Nov 2014 15:57:16 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?43698>

                 Summary: ismatrix not Matlab compatible
                 Project: GNU Octave
            Submitted by: siko1056
            Submitted on: Tue 25 Nov 2014 04:57:15 PM CET
                Category: Interpreter
                Severity: 2 - Minor
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: Need Info
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

I'm not sure, weather this is a Matlab bug or a compatibility issue. In
general Matlab claims, that ismatrix should return true, if the argument has
exactly two non-zero dimensions. This includes for example function handles as
well and excludes 3D-Matrices.

http://www.mathworks.com/help/matlab/ref/ismatrix.html

https://www.gnu.org/software/octave/doc/interpreter/Predicates-for-Numeric-Objects.html#XREFismatrix

Fixing this is quite easy, but might break lots of code, as it is such an
elementary function.

Matlab 2014a:

>> f = @(x) sin(x);
>> size (f)
ans =

   1   1

>> ismatrix (f)

ans =

     1

>> ismatrix (rand(3,3,3))

ans =

     0


Octave dev:

octave:1> f = @(x) sin(x);
octave:2> size (f)
ans =

   1   1

octave:3> ismatrix (f)
ans = 0
octave:4> ismatrix (rand(3,3,3))
ans =  1





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43698>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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