Can Matlab System Object class inherit from a "regular" class? Anyone has an example?

3 ビュー (過去 30 日間)
Ibra
Ibra 2017 年 10 月 11 日
回答済み: Prashant Arora 2017 年 10 月 16 日
I am trying to get a Matlab System Object class that I use in Simulink to inherit from another class apart from the fact that it has to inherit from matlab.System. However, once I add the that class as follows:
classdef siggen < matlab.System & classA
I automatically see this error in Simulink:
Invalid setting in '.../Subsystem/MATLAB System' for parameter 'System'. Caused by:
Error evaluating parameter 'System' in '.../Subsystem/MATLAB System' Caused by:
Not enough input arguments.

回答 (1 件)

Prashant Arora
Prashant Arora 2017 年 10 月 16 日
Hi Ibra,
You should be able to inherit from a different class. I am attaching a small example here to demonstrate this.
Are you able to use this class in MATLAB and not just in Simulink? For example, can you use the following commands?
myObj = siggen;
step(myObj,<args>)
"args" refer to the arguments in your siggen step function, usually specified as the stepImpl function in MATLAB System class.

カテゴリ

Help Center および File ExchangeCreate System Objects についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by