M file and S function block

2 ビュー (過去 30 日間)
Apurv
Apurv 2014 年 1 月 9 日
コメント済み: Kaustubha Govind 2014 年 3 月 13 日
Hey, Is it possible to code a M file from which we can call an S function block??? If yes then, what is the command for it? How can i also give inputs through the m file for the S function block???

採用された回答

David Sanchez
David Sanchez 2014 年 1 月 9 日
You can call your model containing your S-function block from a script (m-file) using the
find_system('Name','your_model');
open_system('yourmodel');
You can set parameters on your model with
set_param();
take a look at
doc set_param
for all the options

その他の回答 (1 件)

Apurv
Apurv 2014 年 1 月 9 日
Hey David, Thanks for your help! I have some more further doubts which I havent been able to figure out. I am looking to set the parameters within the S function builder through an external m file. The parameters such as libraries, input ports, output ports, sample mode, C code and sample mode should be set directly from the external m file. I have been trying to use the m file to get the parameters [get_param()]but I havent been successfull. Could you please suggest some way to build a S function block by an external m file. Thanks
  1 件のコメント
Kaustubha Govind
Kaustubha Govind 2014 年 3 月 13 日
See this previously answered question: sfunction builder function through command line.

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

カテゴリ

Help Center および File ExchangePrepare Model Inputs and Outputs についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by