x = exp([-y:y]);
where y is an integer which normally has a value between 40 and 120.
Running this through simulink results in the following error:
------------------------------------------------
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 :?].
Function 'testing.m' line 8, column 14:
"[-y:y]"
----------------------------------------------------
I know simulink doesn't like variably sized arrays/matrices but I'm not sure I can set an upper bound in this case since it's referring to the operation itself rather than x or y.
Anyone know of a potential work around for this?
Cheers.
Is y and input?
Is x an output?
Or are they local variables?
Phil.
Sorry should have been more clear. It is an Embedded Matlab Function block, x and y are just local variables in this case, though there is a similar function towards the end of the code where the "x" is an output (haven't quite made it that far though).
Thanks,
-Elliot
A example, where y is the output in this case, would be
%%%%%%%%%%% Cut here %%%%%%%%%%
function y = fcn(u)
%#eml
assert(u<100);
vTemp = -u:u;
y = exp(vTemp)';
%%%%%%%%%%% Cut here %%%%%%%%%%
Search the doc for the text "Specifying Upper Bounds for Local Variable-Size Data" to see where this is documented.
Phil.
Works just fine now, cheers!
-Elliot