フィルターのクリア

How can I read "Go To" tags in embedded matlab function in Simulink?

2 ビュー (過去 30 日間)
Salvation
Salvation 2012 年 11 月 9 日
How can I read "Go To" tags in embedded matlab function in Simulink? Can I have 2 inputs to an embedded matlab function in Simulink?

採用された回答

Kaustubha Govind
Kaustubha Govind 2012 年 11 月 9 日
Yes, you can have any number of inputs to your Embedded MATLAB Function block. You can either add additional inputs using the Ports and Data Manager of the block, or simply modify the function prototype to accept multiple inputs. You can connect the output of a From (which reads from a Goto tag) block to your Embedded MATLAB Function block's input.
  3 件のコメント
Kaustubha Govind
Kaustubha Govind 2012 年 11 月 12 日
I'm confused about why you are using MATLAB code to access the Ports and Data Manager. It is accessible via the Embedded MATLAB Editor (looks under one of the menus - probably Edit or Tools).
Salvation
Salvation 2012 年 11 月 22 日
Dear Kaustubha Govind, I was trying the same, Got it finally. Its working fine, had to reinstall a few compilers :) Thanks

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

その他の回答 (1 件)

Anthony Poulin
Anthony Poulin 2012 年 11 月 9 日
Hi,
To read all the goto tags in your model, you can use this code:
block = find_system(gcs,'BlockType','Goto'); Tag = []; for i = 1:length(block) Tag{i,1}=get_param(block{i},'GotoTag'); end
Is answering your question?
  1 件のコメント
Salvation
Salvation 2012 年 11 月 10 日
Thanks Poulin Anthony, but it says "The function 'gcs' is not supported by Embedded MATLAB for code generation"

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by