Code generation requires variable to be fully assigned variable before subscripting it error in Simulink
5 次查看(过去 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
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()
回答(1 个)
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).
You can refer to https://www.mathworks.com/help/simulink/ug/model-callbacks.html
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 General Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!