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

1 回表示 (過去 30 日間)
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.

採用された回答

MathWorks Support Team
MathWorks Support Team 2019 年 11 月 8 日
編集済み: MathWorks Support Team 2019 年 11 月 8 日
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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGetting Started with Microsoft .NET についてさらに検索

タグ

製品


リリース

R2009a

Community Treasure Hunt

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

Start Hunting!

Translated by