Simulink: how to import external jar file

3 次查看(过去 30 天)
Hi,
I am using the MATLAB fcn block in Simulink for some custom function I've in Matlab. My question is the following:
is it possible to use the same Matlab Fcn block, to create a custom matlab function which uses methods available in an external jar file; for example, in matlab i can import the package available in a jar file and uses the classes and methods available here. Is it possible to do with Simulink..if yes, can you tell me how to do it?
thank you
best regards
Paolo

采纳的回答

Salini S Nair
Salini S Nair 2021-10-4
I understand that you want to import a JAR file to Simulink and use the methods available in it. The following MATLAB answer explains how you can achieve this functionality using the Level 2 MATLAB S-function block in Simulink: Is it possible to call JAVA code from within Simulink? - MATLAB Answers - MATLAB Central (mathworks.com). It is not advisable to perform this using the Embedded MATLAB function block since it does not support the use of ‘import’ function as mentioned in the above link.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by