Simulink- user define function - matlab funciton:Size of function not bounded error

10 次查看(过去 30 天)
I met a problem similar as (<http://www.mathworks.com/matlabcentral/newsreader/view_thread/310599),however>, things as little different.
Here is my problem: I create a matlab function in simulink and while i run this model, this block can't not works well: the error is as shown below:
Computed maximum size of the output of function 'colon' is not bounded. Static memory allocation requires all sizes to be bounded. The computed size is [1 x :?].
I follow the instruction and added the upper bound, however, it still not working. I take a look at the report, and find the variable is actually bounded: see pic below
actually, all the variable is bounded.
My code is as shown below:
step_w = (ub-lb)/1000;
coder.varsize('trq_all',[1 1001],[0,1]);
% trq_all = zeros(1,1001)
trq_all = [lb:step_w:ub];
ub is upper bound, lb is lower bound.
Thanks.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Event Functions 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by