Java class to pass complex data to and from MATLAB
Complex class provides Java® support for MATLAB® complex arrays. Use this class to pass complex data to MATLAB. The MATLAB engine passes complex data to Java as an instance of
All MATLAB numeric types are converted to
double in Java.
The real part of the complex data
The imaginary part of the complex data
real, double imag) constructs an instance of
Complex with the specified real and imaginary values.
Pass Complex Variable to MATLAB Function
import com.mathworks.engine.MatlabEngine MatlabEngine engine = MatlabEngine.startMatlab(); Complex c = new Complex(2,3); Complex cj = engine.feval("conj",c);
Introduced in R2016b