How to avoid the dot operator when accessing property inside class method
Afficher commentaires plus anciens
I have a class that contains method. When I access one of properties, I need to use dot operator as follows:
classdef Robot < handle
properties
x
end
function move(obj)
obj.x = obj.x + 1; % how to remove obj.
end
end
As you can see, using obj. with equation that contains alot of properites is not readable. How to avoid this issue as the case in C++. I think it should be default to refer to properties.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Code Generation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!