필터 지우기
필터 지우기

variant control 'VID==0" used by the block

조회 수: 2 (최근 30일)
muhammad usama
muhammad usama 2022년 8월 3일
답변: Dinesh 2024년 4월 12일
i have trained reinforcement learning agent and would like to implement the agent to convege the system to desire input. i have used variant subset and also select the variant mode. The problem arises when i start simulation it shows as given below. Any help or guidance in this regards will be much appreciated.
  댓글 수: 1
Kirthi
Kirthi 2023년 2월 15일
Hello muhammad,
Your variant model needs a control variable to work, you must've set condition as 'VID==0' but didn't not create or initiate the variable. Try creating the variable and setting it to 0. Then run the model.
Hope it helps

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

답변 (1개)

Dinesh
Dinesh 2024년 4월 12일
Hello,
When you define a variant control inside a variant block, it is assumed that you also have created the variant present in the variant control. For example, in this case, you have defined "VID==0" as the variant control which means if VID=0, a set of blocks get executed and another set of blocks get executed if VID is not 0. You are only defining the condition inside the variant block. But the variant VID itself is not being explicitly set anywhere which leads to this error. You can just create a variable "VID" in the base workspace and initialize it to any value.
Here's a link that might help you understand further: https://www.mathworks.com/help/simulink/ug/set-and-open-active-variants.html

Community Treasure Hunt

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

Start Hunting!

Translated by