Simulink: how to import external jar file

3 vues (au cours des 30 derniers jours)
Paolo
Paolo le 1 Oct 2021
Commenté : Paolo le 7 Oct 2021
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

Réponse acceptée

Salini S Nair
Salini S Nair le 4 Oct 2021
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.
  1 commentaire
Paolo
Paolo le 7 Oct 2021
it works perfectly.
Thank you

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by