How do i use dynamic variables with a matlab function in stateflow?
Afficher commentaires plus anciens
In my stateflow model I try to extend a matrix with a matlab function. I have the problem that I always get the error message: 'Computed maximum size of the output of function 'colon' is not bounded. Static memory allocation requires all sizes to be bounded. ...' Then I found that I have to define the maximum size of the matrix but it still won't work. Here is the code of my function:
function MatrixOut = ExtendMatrix(MatrixIn, Stepsize, GRVal1, GRVal2, Minutes)
coder.varsize('Matrix_Out', [30000000 4]);
n = Minutes*60/0.02;
coder.varsize('t_vec', [1 n]);
coder.varsize('MatrixRoh', [n 2]);
Start = MatrixIn(end,1);
t_vec = Start+Stepsize:Stepsize:Start+Minutes*60;
MatrixRoh = [GRVal1.*ones(Minutes*60/StepSize,1)...
GRVal2*ones(Minutes*60/StepSize, 1)];
MatrixOut = [MatrixIn;[t_vec' MatrixRoh sum(MatrixRoh,2)]];
end
MatrixIn is [n 4] an all are double. t_vec is temporary and double. Can somebody help please? Paul
Réponses (0)
Catégories
En savoir plus sur Stateflow dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!