Q:

Java & Matlab Exception

package matlab;

import com.mathworks.toolbox.javabuilder.*;
import com.eigenface.Eigenface;

public class Test {

    public static void main(String[] args) {

        Eigenface core = null;

        Object [] result = null;

        try {

            core = new Eigenface();
            result = core.EigenFace(2);
            System.out.println(result[0]);

        } catch (MWException e) {

            e.printStackTrace();

        }
    }

}

I'm using a Matlab function in a wrapper class, called Eigenface. When I run my code i get this exception: {??? Error using ==> EigenFace
Too many output arguments.
} .
Since the function works with no problem in Matalab, does anyone knows why am I getting this exception?

A:

I believe this call in your code is not correct:
result = core.EigenFace(2);

Is the name of your MATLAB function EigenFace? If not, you should be calling something like:
result = core.yourfunction(2);

You can see the example getmagic.java in MATLAB documentation:
/* Create new magic object */
theMagic = new magic();

/* Compute magic square and print result */
result = theMagic.makesqr(1, n);
System.out.println(result[0]);

