Hauptinhalt

com.mathworks.toolbox.javabuilder.MWNumericArray Class

Namespace: com.mathworks.toolbox.javabuilder

Java class to manage numeric arrays in MATLAB

Description

Declaration

public class MWNumericArray extends MWArray

The MWNumericArray class manages a native MATLAB® numeric array. It serves as the base class for all numeric MATLAB array types and serves as a data container for passing numeric information between Java® and MATLAB code.

Implemented Interfaces: Disposable, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

Creation

Constructors

MWNumericArray()

Creates an empty MWNumericArray of type MWClassID.DOUBLE.

MWNumericArray(boolean rVal, boolean iVal, MWClassID classid)

Constructs a complex numeric double array that represents the primitive boolean arguments.

MWNumericArray(boolean rVal, MWClassID classid)

Constructs a real scalar numeric array that represents the primitive boolean argument.

MWNumericArray(byte rVal)

Constructs a real scalar numeric array of type MWClassID.INT8 that represents the primitive byte argument.

MWNumericArray(byte rVal, byte iVal)

Constructs a complex scalar numeric array of type MWClassID.INT8 that represents the primitive byte arguments.

MWNumericArray(byte rVal, byte iVal, MWClassID classid)

Constructs a complex scalar numeric array that represents the primitive byte arguments.

MWNumericArray(byte rVal, MWClassID classid)

Constructs a real scalar numeric array that represents the primitive byte argument.

MWNumericArray(double rVal)

Constructs a real scalar array of type MWClassID.DOUBLE that represents the primitive double argument.

MWNumericArray(double rVal, double iVal)

Constructs a complex scalar array of type MWClassID.DOUBLE that represents the primitive double arguments.

MWNumericArray(double rVal, double iVal, MWClassID classid)

Constructs a complex scalar array that represents the primitive double arguments.

MWNumericArray(double rVal, MWClassID classid)

Constructs a real scalar array that represents the primitive double argument.

MWNumericArray(float rVal)

Constructs a real scalar numeric array of type MWClassID.SINGLE that represents the primitive float argument.

MWNumericArray(float rVal, float iVal)

Constructs a complex scalar numeric array of type MWClassID.SINGLE that represents the primitive float arguments.

MWNumericArray(float rVal, float iVal, MWClassID classid)

Constructs a complex scalar numeric array that represents the primitive float arguments.

MWNumericArray(float rVal, MWClassID classid)

Constructs a real scalar numeric array that represents the primitive float argument.

MWNumericArray(int rVal)

Constructs a real scalar numeric array of type MWClassID.INT32 that represents the primitive int argument.

MWNumericArray(int rVal, int iVal)

Constructs a complex scalar numeric array of type MWClassID.INT32 that represents the primitive int arguments.

MWNumericArray(int rVal, int iVal, MWClassID classid)

Constructs a complex scalar numeric array that represents the primitive int arguments.

MWNumericArray(int rVal, MWClassID classid)

Constructs a real scalar numeric array that represents the primitive int argument.

MWNumericArray(long rVal)

Constructs a real scalar numeric array of type MWClassID.INT64 that represents the primitive long argument.

MWNumericArray(long rVal, long iVal)

Constructs a complex numeric double array of type MWClassID.INT64 that represents the primitive long arguments.

MWNumericArray(long rVal, long iVal, MWClassID classid)

Constructs a complex numeric double array that represents the primitive long arguments.

MWNumericArray(MWClassID classid)

Creates an empty MWNumericArray of the specified type.

MWNumericArray(java.lang.Object rVal)

Constructs a real numeric array that represents the Object argument using default conversion rules.

MWNumericArray(java.lang.Object rVal, MWClassID classid)

Constructs a real numeric array that represents the Object argument.

MWNumericArray(java.lang.Object rVal, java.lang.Object iVal)

Constructs a complex numeric array that represents the Object arguments using default conversion rules.

MWNumericArray(java.lang.Object rVal, java.lang.Object iVal, MWClassID classid)

Constructs a complex numeric array that represents the Object arguments.

MWNumericArray(short rVal)

Constructs a real scalar numeric array of type MWClassID.INT16 that represents the primitive short argument.

MWNumericArray(short rVal, MWClassID classid)

Constructs a real scalar numeric array that represents the primitive short argument.

MWNumericArray(short rVal, short iVal)

Constructs a complex scalar numeric array of type MWClassID.INT16 that represents the primitive short arguments.

MWNumericArray(short rVal, short iVal, MWClassID classid)

Constructs a complex scalar numeric array that represents the primitive short arguments.

Properties

expand all

Public Properties

A convenient, efficient, and consistent way to represent an empty array as follows:

public static final MWArray EMPTY_ARRAY

Methods

expand all

Examples

collapse all

 MWNumericArray A = new MWNumericArray(MWClassID.INT64);
      System.out.println("A = " + A);
A = []

double AReal = 24;
 
MWNumericArray A = new MWNumericArray(AReal, MWClassID.INT16);
System.out.println("Array A of type " + A.classID() + " = \n" + A);
Array A of type int16 =
          24
 

double AReal = 24;
double AImag = 5;
 
MWNumericArray A = new MWNumericArray(AReal, AImag);
System.out.println("Array A of type " + A.classID() + " = \n" + A);
Array A of type double =
    24.0000 + 5.0000i

double[][] AData = {{ 1, 2, 3, 4, 5, 6},
                    { 7, 8 , 9, 10, 11, 12},
                    {13, 14, 15, 16, 17, 18}};
 
MWNumericArray A = new MWNumericArray(AData, MWClassID.SINGLE);
System.out.println("Array A = \n" + A);
 A =   1   2   3   4   5   6
       7   8   9  10  11  12
      13  14  15  16  17  18
 

Version History

Introduced in R2006a