MATLAB: How to get com.mathworks.engine.* package

com.mathworks.engine.*

Here is my code
import com.mathworks.engine.*;
import java.util.Arrays;
public class javaPutVar {
public static void main(String[] args) throws Exception {
MatlabEngine eng = MatlabEngine.startMatlab();
eng.putVariable("x", 7.0);
eng.putVariable("y", 3.0);
eng.eval("z = complex(x, y);");
String[] w = eng.feval("who");
System.out.println("MATLAB workspace variables " + Arrays.toString(w));
eng.close();
}
}
This code is showing error:
javaPutVar.java:1: error: package com.mathworks.engine does not exist
import com.mathworks.engine.*;
^
javaPutVar.java:6: error: cannot find symbol
MatlabEngine eng = MatlabEngine.startMatlab();
^
symbol: class MatlabEngine
location: class javaPutVar
javaPutVar.java:6: error: cannot find symbol
MatlabEngine eng = MatlabEngine.startMatlab();
^
symbol: variable MatlabEngine
location: class javaPutVar
3 errors
How can I fix this errors? How can I get com.mathworks.engine.* package ?

Best Answer

Are you using release R2016b or later? According to the documentation and the Release Notes that's when this functionality was introduced.