Classes
- classdef. A classdef file defines a class: properties and methods for stateful components.
- Value versus handle. handle classes share identity; value classes copy: the semantics decision made first.
- When OOP. OOP suits instruments, models and apps: data analysis mostly stays functional.
Properties and Methods
- Property validation. Properties declare types and validators: objects that refuse invalid states at assignment.
- Methods. Methods act on the object: with the object as first argument, dot-callable.
- Events awareness. Handle classes emit events: listeners reacting, the pattern under app frameworks.
Reusable Engineering Components
- Encapsulated instruments. A class wraps an instrument or model: setup, state and teardown in one tested unit.
- Packages. Namespaced packages (+folders) organise components: collisions prevented, provenance visible.
- Interfaces by contract. Abstract classes declare contracts: solvers interchangeable behind one interface.
Before and after this level
- Before: Level 8: Statistics & Optimisation: Statistical Analysis, Optimisation, Model Fitting.
- Next: Level 10: Performance: Vectorisation, Profiling, Memory-Efficient MATLAB.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does MATLAB Level 9: Object-Oriented MATLAB cover?
Classes, Properties and Methods, Reusable Engineering Components: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 8: Statistics & Optimisation, which covers Statistical Analysis, Optimisation, Model Fitting.