How to have variable-sized output for Simulink MATLAB-function block?
18 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a MATLAB function-block in Simulink and I would like to have the output port of the block dynamically sized based on an input parameter. Eg:
function[y] = MATLABblock(u, s)
y = someCalc(u,s) %%Returns array of size s %%
Is this possible?
0 Kommentare
Akzeptierte Antwort
Kaustubha Govind
am 22 Jul. 2013
I think this should work as long as you can enforce a maximum size for y. Simulink currently does not support dynamic memory allocation, so you must specify a maximum-size for variable-size signals. Please see the section on Variable-Size Data in the documentation to ensure that your output is configured as variable-size.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Model Verification finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!