octave-maintainers
[Top][All Lists]
Advanced

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

empty object indexing compatibility with Matlab


From: Rik
Subject: empty object indexing compatibility with Matlab
Date: Fri, 11 Aug 2017 08:32:30 -0700

For most data types, an empty index returns the object itself.

--- Code ---
octave:7> x = 1:3
x =

   1   2   3

octave:8> x()
ans =

   1   2   3
--- End Code ----

However, for class objects the behavior is up to the programmer.  However,
I'd like to know if Matlab generally tries to maintain this behavior for
the classdef objects they write.

Could someone try the following code in Matlab?

--- Test Code ---
x = containers.Map (1, 2)
x()
--- End Test Code ---

Thanks,
Rik





reply via email to

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