필터 지우기
필터 지우기

Code generation requires variable to be fully assigned variable before subscripting it error in Simulink

조회 수: 3 (최근 30일)
Dear all,
I am implementing the forward and inverse kinematics of a 6 dof robot arm. I was able to run the code in MATLAB alone and it worked well but when I tried to do the same in SIMULINK, I get an error to define 'theta' and 'dtheta' (the variables in my program) before subscripting it.
Can anyone help me resolve this error?
Appreciate any advice or help
Regards
  댓글 수: 10
Walter Roberson
Walter Roberson 2019년 7월 9일
You were talking about running the code at the MATLAB level, before starting the Simulink model. You can create the timeseries at the MATLAB level using timeseries()
Gautami Golani
Gautami Golani 2019년 7월 18일
Thank you for your help sir.
I was succsesfully able to resolve the error.

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

답변 (1개)

Srivardhan Gadila
Srivardhan Gadila 2019년 7월 18일
Hi Gautami,
“Callbacks” in Simulink can be used to initialize any variables required for the model simulation.
You might initialize the variables “theta” and “dtheta” in the model callbacks (In Simulink: View->Property Inspector->Callbacks).

카테고리

Help CenterFile Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by