inherit from two classes simscape

1 次查看(过去 30 天)
What is the syntax to inherit from two superclasses in Simscape?
  2 个评论
Adam
Adam 2019-10-2
Does the usual dual inheritance syntax not work in Simscape (I have no idea what that is as I don't use it)?
classdef myClass < superclass1 & superclass2
LEO LEON
LEO LEON 2019-10-10
In simscape it does not work, but thanks.

请先登录,再进行评论。

回答(2 个)

J Chen
J Chen 2019-10-2
Try the following:
component MyComponent < MyBaseComponent1
% component implementation here
end
component MyExtendedComponent < MyComponent
% component implementation here
end
  1 个评论
LEO LEON
LEO LEON 2019-10-10
It is a bit awkward and Im not sure it will do the job. But I will try it.
Thanks

请先登录,再进行评论。


Srimouli Rukmabhatla
Hi LEO,
For more information please go through the documentation of Subclassing and Inheritance https://www.mathworks.com/help/physmod/simscape/lang/subclassing-and-inheritance.html

类别

Help CenterFile Exchange 中查找有关 Foundation and Custom Domains 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by