Variables scope in MatLab function block

2 visualizaciones (últimos 30 días)
Tamim Boubou
Tamim Boubou el 22 de Feb. de 2021
Comentada: Tamim Boubou el 25 de Feb. de 2021
Hello everyone,
I have a simulink file, in which I'm using a matlabFunction block, this function is calling several other functions and files including some structures in the same path, but whenever I run the simulation, the variables that are defined in the workSpace are not visible for the "matlab function" block, is there any way of changing their scope or any approach to fix this other than having to re-define all the variables locally within that block?

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 22 de Feb. de 2021
Use "Edit Data" in the MATLAB Function Editor to specify those base workspace variables as the parameters
  1 comentario
Tamim Boubou
Tamim Boubou el 25 de Feb. de 2021
Thank you!, I didn't know of this method before.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulink Functions en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by