How to change the signal in Signal Builder Block from m-file?

11 ビュー (過去 30 日間)
Mohammad
Mohammad 2017 年 4 月 24 日
編集済み: Mohammad 2017 年 4 月 27 日
Hi, I am using "Signal Builder" block in a Simulink model and I am going to run it many times (using a for loop in a m-file). Now I want that in each run of simulation the Sampled Gaussian Noise generated by the signal builder block CHANGES to a new one by using a command from m-file instead of opening the Signal Builder block and replace the signal with a new one. I wonder how I can do that. Thanks, Mohammad

回答 (1 件)

Sebastian Castro
Sebastian Castro 2017 年 4 月 25 日
The Signal Builder block can be accessed programmatically with the signalbuilder function. Hopefully the examples in the following page can help you get started.
If all you're doing is switching between existing signal groups and running the model, that should be fairly straightforward to do this way. If you're actually trying to create/load new data every run, I'd recommend doing this with an input port or From Workspace block instead.
Sebastian
  1 件のコメント
Mohammad
Mohammad 2017 年 4 月 27 日
編集済み: Mohammad 2017 年 4 月 27 日
Hello Sebastian,
Thanks for your answer. I went through that page but I get a little confused. What I am actually trying to do is that in a for loop in each run I want Signal Builder block to generate a "new" sampled Gaussian Noise. It can be done in the block's page by going to Signal->Replace with->Sampled Gaussian Noise. Actually I want to do that in the m-file in each iteration. I hope I could convey my purpose well. I appreciate if you could help with me that.
Better saying: How can I tell the Simulink to generate "Sampled Gaussian Noise" in the signalbuilder block from command window?

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

カテゴリ

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