How can I call a method in my .NET assembly from Simulink 7.3 (R2009a)?

1 visualización (últimos 30 días)
I want to call a function that is part of a .NET assembly from my Simulink model. I would like to know if this is possible.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 8 de Nov. de 2019
Editada: MathWorks Support Team el 8 de Nov. de 2019
Starting in MATLAB 7.8 (R2009a), the MATLAB interface to the .NET framework allows .NET assemblies to be loaded into MATLAB, create instances of .NET objects in the MATLAB workspace and to call methods from .NET assemblies.
In order to call a method from a .NET assembly in Simulink, utilize the "MATLAB Function" block in Simulink. Attached is an example showing how to call a method from a .NET assembly via a MATLAB function called from the MATLAB Function Simulink block.
In order to run the example, implement the following steps:
1. Save the attached files in a directory
2. In MATLAB 7.8 (R2009a), change your current working directory to the directory where you stored the files.
3. Open the .mdl file
4. Start simulation

Más respuestas (0)

Etiquetas

Productos


Versión

R2009a

Community Treasure Hunt

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

Start Hunting!

Translated by