I'm afraid I donβt know how to do exactly what you requested, but there are two ways to do something like this:
1) If you set up a Java callback from Matlab, you can send it a handle to the Matlab function. When the Java callback event is raised, the Matlab function will be activated. An example of this can be found here: http://UndocumentedMatlab.com/blog/uicontrol-callbacks/ . Please note that JMI is not required to run.
2) JMI needs a string (function name or command line) to evaluate Matlab. If you know the name of the function in advance, you can use it. Otherwise, you can prepare the Switch-yard Matlab function (whose name is known in advance) to dynamically direct your callback to the corresponding Matlab action.
I plan to launch an article on JMI at http://UndocumentedMatlab.com in mid-April, so stay tuned ...
Yair Altman
Yair altman
source share