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

3 vues (au cours des 30 derniers jours)
Sam136
Sam136 le 14 Jan 2016
Commenté : Walter Roberson le 14 Jan 2016
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?

Réponse acceptée

Steven Lord
Steven Lord le 14 Jan 2016
Try using LINSPACE instead.
  1 commentaire
Walter Roberson
Walter Roberson le 14 Jan 2016
Remember to use 101 points to get intervals of 1/100 of the range.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Simulink dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by