Get a property from a class
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Andrea Agostini
am 22 Jul. 2019
Kommentiert: Andrea Agostini
am 23 Jul. 2019
Hello,
I have a class as per attached file "ktmDbiAccess.m".
I would like the property "fullFileName" is read ony; in my understanding I have to greate a get method to do that but I cannot understand how. I have found this example but it is not clear me yet how I have to modify the class and how should I call the "get" method in the caller script.
May you please provide an example? Or just modify my class.
regards,
Andrea
0 Kommentare
Akzeptierte Antwort
Sean de Wolski
am 22 Jul. 2019
You can set the SetAccess attribute of the properties block including it to make it read-only. No reason to deal with get(), actually, it would be set(), but still unnecessary.
properties (SetAccess = private)
fullFileName
end
Siehe auch
Kategorien
Mehr zu Software Development Tools finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!