MATLAB: What are the differences (if any) between Matlab system objects and class objects

object-oriented

Matlab includes a wide variety of System Objects, that seem to be standard Matlab objects (typically singletons) which derive from matlab.System ( ref ).
My question: is there any real difference between System Objects and any other class object used in Matlab?

Best Answer

In my own words, System objects are a subset of standard MATLAB class objects which inherit from an interface class named matlab.System. The interface class specifies methods that should be implemented by an author of a System object - each of these methods determine the behavior of the System object (eg. getNumInputsImpl, getNumOutputsImpl, stepImpl, etc.). In essence, System objects provide an infrastructure/platform for you to define a "system" in MATLAB.
I think the concept of System objects will more completely resonate with Simulink users, because IMHO System objects are a lot like S-functions, except that they can be used the same way in both MATLAB and Simulink. Methods like setupImpl, resetImpl, stepImpl, releaseImpl, etc. can be used to define a system more completely, as opposed to a MATLAB function which can only define an algorithm, but not a system.
Related Question