Hi,
I am trying to get value form a java class method. My Java code is as follows:
public class HelloWorld { public static void main( String args[] ) { System.out.println( "Hello World:" ); if (args.length >0){ System.out.println( args[0] ); } } public int f1 (String args[]){ if (args.length >0){ System.out.println( args[0] ); } return 123; } }
When I try to execute the f1 method, it works as long as I am not attempting to get the value 123 to a MATLAB variable. What am I doing wrong? How do I fix this?
Trial>> o=HelloWorldo =HelloWorld@4a8b5227Trial>> javaMethod('f1',o,'ABC')ABCTrial>> o.f1('ABC')ABCTrial>> a=javaMethod('f1',o,'ABC')ABCOne or more output arguments not assigned during call to "javaMethod".Trial>> a=o.f1('ABC')ABCOne or more output arguments not assigned during call to "f1".Trial>>
Best Answer