Can we find simulink signal object used in the model using Simulink.findVars?

1 view (last 30 days)
Can we find simulink signal object used in the model using Simulink.findVars.
Will you tell me how to find all the simulink signal object used in the model.

Answers (1)

Fangjun Jiang
Fangjun Jiang on 14 Sep 2018
Edited: Fangjun Jiang on 15 Mar 2024
Yes. Make a simple example and you can find it out.
Updated in March 2024 using MATLAB R2022b.
Make a simple Simulink model, for example, a Constant block connected to a Gain block. Set the constant value as ConstA, label the output of the Gain block as SignalA and check "Signal name must resolve to Simulink signal object".
Creat ConstA=Simulink.Parameter(0) and SignalA=Simulink.Signal in base workspace
Create extra ConstB=Simulink.Parameter(0) and SignalB=Simulink.Signal in base workspace to experiment un-used data
Run variables = Simulink.findVars('ModelName') will return ConstA and SignalA.
  3 Comments
Sumit Kumar
Sumit Kumar on 15 Mar 2024
Can you please share the script for this, Is there any way to find Simulink.Signal objects ?

Sign in to comment.

Categories

Find more on Interactive Model Editing 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!