필터 지우기
필터 지우기

String as variable in simulink

조회 수: 2 (최근 30일)
Tomas Iesmantas
Tomas Iesmantas 2011년 6월 20일
Hi, I created my own library of simulink and simscape components. One component is pressure sensor and have scope inside it. I need to save information from that scope in workspace or in file. But every time I have to go inside this component and change file or variable name, because even though names of components do change, but names under which data have to be saved doesn't. So I need way to provide filme or variable name through parameters in component mask. I know how to do that when variable is not a string, but in this case i'm stuck. I tried also "To File" and "To Workspace" components, not just "Scope". Any help and suggestions will be very appreciated.
Tomas

채택된 답변

Arnaud Miege
Arnaud Miege 2011년 6월 20일
In the Initialization pane, use set_param to set the parameter of the scope, To File or To Workspace block with the mask parameter. If the block is part of a library, you'll need to tick the check-box that says Allow library block to modify its contents.
HTH,
Arnaud
  댓글 수: 1
Tomas Iesmantas
Tomas Iesmantas 2011년 6월 20일
Thanks Arnaud, It works just fine.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scopes and Data Logging에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by