Is there a way to detect the index/position of the setted value inside a new defined setter method?
I mean, if I call
val = ...
obj.Prop = val;
does different calculations on specific indices.
In MATLAB documentation is a short description I don't really understand________________________________________
Access Methods and Properties Containing Arrays
You can use array indexing with properties that contain arrays without interfering with property set and get methods.
For indexed reference:
val = obj.PropName(n);
MATLAB calls the get method to get the referenced value.
For indexed assignment:
obj.PropName(n) = val;
- Invokes the get method to get the property value
- Performs the indexed assignment on the returned property
- Passes the new property value to the set method