Rigid transform and legacy workspace variable problem

조회 수: 3 (최근 30일)
Adam Olsson
Adam Olsson 2019년 11월 4일
댓글: Steve Miller 2021년 11월 17일
Is there a problem with Rigid Transform blocks in Matlab Simscape?
The problem I have noticed occurs when I reuse a rigid transform block. I typically copy a block and then replace a translation with a standard rotation within a rigid transform. The translation value is defined as a workspace variable and the new rotation is also a workspace variable. I chose to put the translation "method" to none as I no longer use the translation, only use rotation.
Once I delete the workspace variable for translation and update the model Simscape asks for the translation variable. It looks to me as it is still required (need to be defined) but not in use.
Anyone else experience the same or similar problems?
I guess I have to stop reusing rigid transforms ;)
__
Regads, Adam

채택된 답변

Steve Miller
Steve Miller 2021년 11월 16일
Some blocks in Simulink will evaluate parameters that are not active, and if they refer to undefined MATLAB variables they will issue an error. In a newer release, Simulink may ignore those parameters. If you are using a release where they are still evaluated, the best thing to do is set that parameter value back to the default. You can do this programmatically using set_param().
--Steve
  댓글 수: 2
Adam Olsson
Adam Olsson 2021년 11월 17일
Thanks for the follow up.
I have not evaluated the issue in newer releases, but I will take your advice with me. My workaround is to never reuse blocks.
__
Regards, Adam
Steve Miller
Steve Miller 2021년 11월 17일
It is generally a good idea to pull in a new block. Even if MATLAB didn't evaluate those parameters, someone else who looks at the model might wonder why they are there and if they are required.
--Steve

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Applications에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by