[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
- empty object indexing compatibility with Matlab,
Rik <=