From Matlab to Java To Matlab

· Interoperability, JAVA, Matlab
Authors

Lately, most of my testers are either Java or Matlab.

You can’t do (not in linear time 🙂 ) your Matlab magics with Java, and you can only dream on your Java OOD capabilities when working with Matlab…

A nice workaround is to combine your testers; work on your main programming language of interest, and call back and forth to the other one:

From Java to Matlab:

The idea is create a “Matlab Control” and then run (=evaluate) Matlab code:

  1. MatlabControl.eval(String your_matlab_command)
  2. MatlabControl.feval(String your_matlab_function_name, Object[] args)

The complete solution from: Kamin Whitehouse

 

From Matlab to Java (a little more built-in):

  • For using Java objects:

javaMethod(‘java_instance_method_by_name’,your_java_object,matlab_value)

  • For using static Java methods:

javaMethod(‘java_static_method_by_name’,’java_type_namespace’,matlab_value)

The complete official Matlab link

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: