How can I read "Go To" tags in embedded matlab function in Simulink?
조회 수: 1 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
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
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).
추가 답변 (1개)
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?
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!