|
From: | Julien Bect |
Subject: | Re: Matlab compatibility or not Matlab compatibility |
Date: | Tue, 16 Feb 2016 08:03:49 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 |
Le 15/02/2016 11:38, Julien Bect a écrit :
Le 12/02/2016 23:51, Sebastian Schöps a écrit :Here we go:versionans = 9.0.0.307022 (R2016a) Prereleasescript_testx = A object: 3-by-4-by-5 ans = 2Thank you Sebastian.So, the conclusion is that Matlab's ndims() function doesn't not respect the size returned by the overloaded size() function...I still wonder whether we should consider this as a bug in Matlab or as a feature to be reproduced. The documentation suggests the first option:http://fr.mathworks.com/help/matlab/ref/ndims.html (see More About > Algorithms).I will check what happens with classdef-style classes (my example was for old-style classes).
Please find attached an extended code snippet that also tests the behavior of classdef-style classes.
On Matlab R2012a the answer is the same : the value returned by size() is not respected by ndims().
Could someone please try and report the result for a more recent release ?
essaiOverloadSize.tar
Description: Unix tar archive
[Prev in Thread] | Current Thread | [Next in Thread] |