Simulink- user define function - matlab funciton:Size of function not bounded error
5 views (last 30 days)
Show older comments
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 :?].
Next, i search online and find this page: http://www.mathworks.com/help/simulink/ug/defining-variable-size-data-for-code-generation.html
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 Comments
Answers (0)
See Also
Categories
Find more on Event Functions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!