Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

com.mathworks.matlab.types.Complex class

Package: com.mathworks.matlab.types

Java class to pass complex data to and from MATLAB

Description

The 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 Complex.

All MATLAB numeric types are converted to double in Java.

Constructor Summary

Complex(double real, double imag) constructs an instance of Complex with the specified real and imaginary values.

Field Summary

double real

The real part of the complex data

double imag

The imaginary part of the complex data

Examples

expand all

import com.mathworks.engine.MatlabEngine

MatlabEngine engine = MatlabEngine.startMatlab();
Complex c = new Complex(2,3);
Complex cj = engine.feval("conj",c);

Introduced in R2016b

Was this topic helpful?