Borrar filtros
Borrar filtros

Interpreted custom function in Simulink

5 visualizaciones (últimos 30 días)
Vicente
Vicente el 20 de Abr. de 2015
Comentada: Vicente el 30 de Abr. de 2015
Hello!
About the "MATLAB Function" block in Simulink, is there any way to avoid the compilation of the respective matlab file and let it be interpreted instead? Because the file is currently using some Matlab functions which prevent the block from compiling (es. try/catch, getfl, etc).
Thank you.

Respuesta aceptada

Sebastian Castro
Sebastian Castro el 20 de Abr. de 2015
Editada: Sebastian Castro el 20 de Abr. de 2015
Yes -- you can use coder.extrinsic to declare those unsupported functions as extrinsic. Check out the "plot" example in the documentation link.
EDIT: Actually, for Try/Catch this still may not work. You can use an Interpreted MATLAB Fcn block in that case.
- Sebastian
  1 comentario
Vicente
Vicente el 30 de Abr. de 2015
Hi! Thank you for your answer, much appreciated, and so sorry for the late response, but here it is!
Is it possible to omit compilation for an entire class method? Even if i used 'coder.extrinsic()' for all the non compilable functions being called in such method, the problem remains as it assigns some class properties dynamically, for example:
obj.(prop_name) = prop_val; %with prop_name being a variable (string).
Symulink displays the following error: "Non-constant expression or empty matrix. This expression must be constant because its value determines the size or class of some expression. In this context, the value of the string must be known."
It would be very useful if there was a way to do this which I'm asking, as the alternative for it would be way too burdensome.

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by