Examples of classes inheritance, public and private attributes and methods from chapter 5.7 of the new edition of book by Bogumila and Zbigniew Mrozek. Comments are in Polish and English language. Save all files in same folder, then run: See also improved OOP examples of "Object oriented program example: animated traffic lights on road intersection" by Bogumila & Zbigniew MROZEK
(1) m571 -- how to define class and introduce object ,
(2) m573 -- error, as private attribute is not seen outside its object
(3) m574 -- private attribute is seen, if get function is used
(4) m575 -- testing trasa method, do I have enough fuel?
(5) m590 -- inheritance test
Nice examples, but the english comments are missing ...
Smaller picture of book cover
Minor changes in descrioption
tested with MATLAB (R2016a), changed "Description" .
Tested with MATLAB 2012B, Screenshot changed.
minor changes in Auto.m m571.m m590.m
More comments in English language.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.