Add a "Function Call Output" in a "Embedded MATLAB Function block" from command window

3 ビュー (過去 30 日間)
Hello,
I would like to know how to add a "Function Call Output" in a "Embedded MATLAB Function block" from the command Window.
Thanks

採用された回答

Kaustubha Govind
Kaustubha Govind 2012 年 3 月 26 日
Do you mean you want to produce a function-call signal to use with a Function-Call Subsystem? If yes, I don't think this is possible with an (Embedded) MATLAB Function block at all. Have you been able to do this manually (let alone from the command prompt)?
EDIT
Turns out, it is possible to generate function-calls from a MATLAB Function block. After playing with the Stateflow API, I was able to come up with this:
S=sfroot;
B = S.find('Name','MATLAB Function','-isa','Stateflow.EMChart');
fc = Stateflow.FunctionCall(B); % add a function call output to block
Caveat: This is not documented, so there is no guarantee that it will work in future releases.

その他の回答 (1 件)

Denis Tiliacos
Denis Tiliacos 2012 年 3 月 26 日
Hello,
I would like to do, from the command prompt, the following manual actions :
- From an Embedded MATLAB Function block, double-click on it in order to open the Embedded MATLAB Editor.
- In the "Tools" menu, click on "Edit Data/Ports". It will open the "Ports and Data Manager"
- In the toolbar, click on the "Add Function Call Output" pushbutton.
  2 件のコメント
Kaustubha Govind
Kaustubha Govind 2012 年 3 月 29 日
Ah! You're right! This is possible. I've updated my answer.
Denis Tiliacos
Denis Tiliacos 2012 年 3 月 30 日
Thank you very much.
I have other questions about function call outputs. I created a new post :
http://www.mathworks.fr/matlabcentral/answers/33975-function-call-use-in-an-embedded-matlab-function-block
Could you have a look please ?
Thanks

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

カテゴリ

Help Center および File ExchangeSchedule Model Components についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by