linspace not working on MATLAB Coder
7 views (last 30 days)
I have some problem with linspace operator inside simulink.
I want to take a decision among a finite set of angles, which I define as
delta = linspace(-r_max*Tc_usbl,r_max*Tc_usbl,decisions)
r_max being the maximum angular velocity, Tc_usbl the control period, 'decisions' the number of angles I want in my set. In the Command Window everything works fine; and iy should work in Simulink too, since I succesfully tried
delta_max = -0.1; decisions = 3;
for delta = linspace(-delta_max,delta_max,decisions)
But my code actually is
for delta = linspace(-r_max*Tc_usbl,r_max*Tc_usbl,decisions)
Where all arguments are static parameters from the Workspace.
I get the following error:
FOR loop index expressions of unknown size are only supported if they are of the form A:B or A:B:C
If it is not possible to use linspace the way I'd like to, does someone has any other idea? But how can I get with colon something similar to