I have a function that returns a handle to an object. Sort of:
function handle = GetHandle() handle = SomeHandleClass(); end
I would like to be able to use the return value as if I were writing a program in C:
foo = GetHandle().property;
However, I get an error from MATLAB when it tries to parse this:
??? Undefined variable "GetHandle" or class "GetHandle".
The only way to get this to work without error is to use a temporary variable as an intermediate step:
handle = GetHandle(); foo = handle.property;
Is there a simple and elegant solution to this, or is it just not possible with MATLAB syntax?
source share