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

5 ビュー (過去 30 日間)
Sainath
Sainath 2014 年 9 月 24 日
コメント済み: Fangjun Jiang 2024 年 3 月 15 日
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.
  1 件のコメント
Pratik Patil
Pratik Patil 2018 年 9 月 14 日
Hello Sainath,
Did you find the answer for this question. I am looking for the solution of this problem.

サインインしてコメントする。

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2018 年 9 月 14 日
編集済み: Fangjun Jiang 2024 年 3 月 15 日
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 件のコメント
Sumit Kumar
Sumit Kumar 2024 年 3 月 15 日
Can you please share the script for this, Is there any way to find Simulink.Signal objects ?
Fangjun Jiang
Fangjun Jiang 2024 年 3 月 15 日
See updates in the answer

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSources についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by