|
From: | Nicholas Jankowski |
Subject: | Re: Matlab compatibility or not Matlab compatibility |
Date: | Tue, 16 Feb 2016 13:06:25 -0500 |
Le 15/02/2016 11:38, Julien Bect a écrit :
Le 12/02/2016 23:51, Sebastian Schöps a écrit :
Here we go:
ans =version
9.0.0.307022 (R2016a) Prerelease
x =script_test
A object: 3-by-4-by-5
ans =
2
Thank 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 ?
[Prev in Thread] | Current Thread | [Next in Thread] |