bugGNU Octave - Bugs: bug #43698, ismatrix not Matlab compatible

 
 

bug #43698: ismatrix not Matlab compatible

Submitter:  Kai Torben Ohlhus <siko1056>
Submitted:  Tue 25 Nov 2014 03:57:15 PM UTC
   
 
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Duplicate Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 25 Nov 2014 04:03:53 PM UTC, comment #1: 

Sorry, duplicate of bug #42422.



Thanks for the bug report. This particular bug has already been
reported into our bug tracking system, but please feel free to
report any further bugs you find.

Kai Torben Ohlhus <siko1056>
Group Member
Tue 25 Nov 2014 03:57:15 PM UTC, original submission:  

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


Kai Torben Ohlhus <siko1056>
Group Member

 

(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 siko1056 (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-11-25 siko1056 StatusNeed Info Duplicate
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code