Simulink - find_system does not work properly

조회 수: 21 (최근 30일)
JOKY JOKE
JOKY JOKE 2012년 1월 19일
Hi,
I use find_system in my Matlab script to find a library block in my simulink model, which I tagged (find_system('model', 'tag' ,'tag_name'). This works nicely, however, when I open the model using my script and then execute find_system, it does not get the handle constantly. Sometimes it does, sometimes it doesnt. When I once run the model, its ok. However, this is not a good solution. I really need to open the model and then execute find_system right away. Does anyone know, why find_system does not work properly in this case and what I can do?
Thank you
  댓글 수: 2
TAB
TAB 2012년 1월 20일
find_system() can be used in many ways with many options.
Please post your code so we can get some idea what you are doing and where is the problem.
JOKY JOKE
JOKY JOKE 2012년 1월 20일
Here is the code:
h_development = find_system(gcs, 'tag', 'Development_Tool_Config');
I get an empty cell array (but only after opening the model, once it ran, it works)

댓글을 달려면 로그인하십시오.

답변 (1개)

Titus Edelhofer
Titus Edelhofer 2012년 1월 20일
Hi,
if the block is in a library, you should "follow links", i.e.,
find_system(gcs, 'FollowLinks', 'on', 'Tag', 'Development_Tool_Config');
instead of gcs it might be more safe to use the model name directly.
Titus

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by