Computed maximum size of the output of function 'colon' is not bounded.

조회 수: 4 (최근 30일)
Hello,
I get this error in a Matlab function of my Simulink code: 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 :?].
Here is the Matlab function:
function y=fcn(a,b)
stp=(b-a)/100
y=a:stp:b
a and b are two constants as inputs to the block. When I define a and b inside the Matlab function, I don't get the error. How can I solve this problem?

채택된 답변

Steven Lord
Steven Lord 2016년 1월 14일
Try using LINSPACE instead.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by