How to get handle of the block calling Matlab.System funcion from within the called function?

3 views (last 30 days)
Hi,
I would like to use several Matlab.System blocks, which are defined by the same Matlab.System function. However, I need to find out the name or handle to the block, which calls the matlab.System function.
To be more specific - let's see the screenshot. I have two Matlab System blocks, SimilarSystem1 and SimilarSystem2 and both of them I would like to implement with the same class CommonDefinition. In the stepImpl method of the CommonDefinition class I would like to be able to distinguish, if the function is called from the SimilarSystem1 or SimilarSystem2.
In this case, will Matlab create two instances of CommonDefinition class or only one instance will be created and used for both blocks?
Thank you.
O.Z.

Answers (1)

Jimmy Clarenburg
Jimmy Clarenburg on 9 Nov 2020
Hi Ondrej Zlevor,
Did you get this to work? I am trying to do something similar.

Categories

Find more on Create System Objects in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!