Using matlab java package in Java
Show older comments
Hi everyone, I implemented 2 function in matlab. The first function returns an array of cell objects, an array of integers and a single integer:
[cell_object, idarray,n] = function1(); the second functions takes in input this 3 value: function2(cell_object,idarray,n);
In matlab I don't have any problems. I compiled this code for Java Package (using mcc -W 'java:...' etc.). After I got a package with 2 classes, one class for function (Class1 for function1 and Class2 for function2), each class contains a method called as the name of its function.
My question is, in Java how to get the output parameters from the first function and pass them to the second function? I tried to do this: Object[] params = class1.function1(0); class.function2(null,params); but params is empty after the call of function1().
I have another quastion. Is possible in Matlab define 2 function in the same .m file and compile it as java package obtaining one class with 2 method? I want to make global variable in the 2 function, so I can work in java without pass arguments between the 2 methods.
Thanks
Accepted Answer
More Answers (0)
Categories
Find more on Java Package Integration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!