필터 지우기
필터 지우기

Send Messages to Java

조회 수: 1 (최근 30일)
shaz
shaz 2012년 8월 26일
Hi
I have a .m files & they needs to be converted to JAR files using Java Builder .
these Jar files are called in java environment(here i am successfully able to pass arguments between java & matlab) .
But now i need to pass a message to java when i am in mid of the execution of my function if any value goes beyond expected values.
for eg: this function finally i am building JAR using Matlab toolbox
function [a] = example (b,c)
d= b+c;
suppose if d value is negative i would like to send message to java saying d value % back to java
a= d+10;
end

채택된 답변

Titus Edelhofer
Titus Edelhofer 2012년 8월 26일
Hi,
"to send a message" is not directly possible, but I could imagine several "workarounds". One suggestion would be to add a parameter to your function that can take the strings 'test' or 'compute'. With 'test' you validate the parameters and give back to your java either 'ok' or a descriptive error message. If 'ok' the java code calls the compiled code again with the same parameters.
Titus

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Java Package Integration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by