How to declare a function as extrinsic and execute it in Simulink through Matlab Function block

조회 수: 5 (최근 30일)
Hello everyone,
I wanted to call a Java function using the Matlab function block in Simulink however i got this error:
Error:Undefined function or variable 'java.security.MessageDigest.getInstance'.
Function 'MATLAB Function' (#24.499.549), line 14, column 20:
"java.security.MessageDigest.getInstance('SHA-256')"
To solve it, I thought about packaging the Java call into a separate function and store it in the MATLAB Function block with coder.define extrinsic however, I do not know how to to declare a function as extrinsic and implement this in simulink.
If anyone has a solution, I would be very happy about your support.
Thank you in advance for your help.

채택된 답변

Paul
Paul 2023년 7월 8일
Try using coder.extrinsic to declare the wrapper .m function as extrinsic in the Matlab Function block and call the java function from the wrapper function.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by