Running Java code from MATLAB

I have a Java class which runs smoothly in eclipse. I would like to run the java code from the MATLAB command line. I have added the .class file to the java static path within MATLAB. I am able to create a java object within MATLAB of the java class I wish to run. I can call upon a method within the class but I can't run the entire code (call upon the constructor of the class).
This is my java code for InterfaceTest.class:
package com.rapplogic.xbee.examples.wpan;
public class InterfaceTest {
int [] y = fill(1, 2, 3);
public static int [] fill (int a,int b,int c) {
int [] r = new int [] {a,b,c};
return r;
}
public static void main(String[] args) {
int [] y = fill(1, 2, 3);
System.out.println (y[0]);
System.out.println (y[1]);
System.out.println (y[2]);
} }

Risposte (0)

Prodotti

Richiesto:

il 20 Mar 2013

Community Treasure Hunt

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

Start Hunting!

Translated by