With graphics handles, you can do this:
>> a = nan(1,5)
a =
NaN NaN NaN NaN NaN
>> a(3) = line([1 2],[1 2])
a =
NaN NaN 0.0042 NaN NaN
>> find(~isnan(a),1,'first')
ans =
3
If this is done with a normal handle-derived class, this error happens:
>> a(3) = MyObject(1,1,1)
The following error occurred converting from MyObject to double:
Error using double
Conversion to double from MyObject is not possible.
As far as I understand, graphics handles are just doubles. Can custom objects also behave this way?