Package matlabcontrol.link
Class MatlabDoubleMatrix<T>
- java.lang.Object
-
- matlabcontrol.link.MatlabDoubleMatrix<T>
-
public abstract class MatlabDoubleMatrix<T> extends java.lang.Object- Since:
- 4.2.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract MatlabDoublegetElementAtIndices(int row, int column)abstract MatlabDoublegetElementAtIndices(int row, int column, int page)abstract MatlabDoublegetElementAtIndices(int row, int column, int... pages)Gets the element at the specifiedrow,column, andpages.abstract MatlabDoublegetElementAtLinearIndex(int linearIndex)Gets the element atindextreating this array as a MATLAB column vector.static <T> MatlabDoubleMatrix<T>getFull(T real, T imag)abstract doublegetImaginaryElementAtIndices(int row, int column)abstract doublegetImaginaryElementAtIndices(int row, int column, int page)abstract doublegetImaginaryElementAtIndices(int row, int column, int[] pages)abstract doublegetImaginaryElementAtLinearIndex(int linearIndex)intgetLengthOfDimension(int dimension)Returns the length of the dimension specified bydimension.intgetNumberOfDimensions()Returns the number of dimensions of the array.intgetNumberOfElements()The number of elements in the array.abstract doublegetRealElementAtIndices(int row, int column)abstract doublegetRealElementAtIndices(int row, int column, int page)abstract doublegetRealElementAtIndices(int row, int column, int[] pages)abstract doublegetRealElementAtLinearIndex(int linearIndex)static MatlabDoubleMatrix<double[][]>getSparse(int[] rowIndices, int[] colIndices, double[] real, double[] imag, int numRows, int numCols)booleanisReal()Returnstrueif the array has no imaginary values,falseotherwise.TtoImaginaryArray()Returns an array that holds the imaginary values from the MATLAB array.TtoRealArray()Returns an array that holds the real values from the MATLAB array.
-
-
-
Method Detail
-
getFull
public static <T> MatlabDoubleMatrix<T> getFull(T real, T imag)
-
getSparse
public static MatlabDoubleMatrix<double[][]> getSparse(int[] rowIndices, int[] colIndices, double[] real, double[] imag, int numRows, int numCols)
-
getRealElementAtLinearIndex
public abstract double getRealElementAtLinearIndex(int linearIndex)
-
getImaginaryElementAtLinearIndex
public abstract double getImaginaryElementAtLinearIndex(int linearIndex)
-
getRealElementAtIndices
public abstract double getRealElementAtIndices(int row, int column)
-
getRealElementAtIndices
public abstract double getRealElementAtIndices(int row, int column, int page)
-
getRealElementAtIndices
public abstract double getRealElementAtIndices(int row, int column, int[] pages)
-
getImaginaryElementAtIndices
public abstract double getImaginaryElementAtIndices(int row, int column)
-
getImaginaryElementAtIndices
public abstract double getImaginaryElementAtIndices(int row, int column, int page)
-
getImaginaryElementAtIndices
public abstract double getImaginaryElementAtIndices(int row, int column, int[] pages)
-
getElementAtLinearIndex
public abstract MatlabDouble getElementAtLinearIndex(int linearIndex)
Gets the element atindextreating this array as a MATLAB column vector. This is equivalent to indexing into a MATLAB array with just one subscript.- Returns:
- element at
index
-
getElementAtIndices
public abstract MatlabDouble getElementAtIndices(int row, int column)
-
getElementAtIndices
public abstract MatlabDouble getElementAtIndices(int row, int column, int page)
-
getElementAtIndices
public abstract MatlabDouble getElementAtIndices(int row, int column, int... pages)
Gets the element at the specifiedrow,column, andpages.- Returns:
- element at
row,column, andpages
-
isReal
public boolean isReal()
Returnstrueif the array has no imaginary values,falseotherwise. Equivalent to the MATLABisrealfunction.- Returns:
-
toRealArray
public T toRealArray()
Returns an array that holds the real values from the MATLAB array. Each call returns a new copy which may be used in any manner; modifications to it will have no effect on this instance.- Returns:
- real array
-
toImaginaryArray
public T toImaginaryArray()
Returns an array that holds the imaginary values from the MATLAB array. Each call returns a new copy which may be used in any manner; modifications to it will have no effect on this instance. If this array is real then the returned array will be have0as all of its base elements.- Returns:
- imaginary array
-
getNumberOfElements
public int getNumberOfElements()
The number of elements in the array. The real and imaginary components of a number are together considered one element. This is equivalent to MATLAB'snumelfunction.- Returns:
- number of elements
-
getLengthOfDimension
public int getLengthOfDimension(int dimension)
Returns the length of the dimension specified bydimension. Dimensions use 0-based indexing. So the first dimension, which is dimension 0, is the row length. The second dimension is the column length. The third dimension and beyond are pages.- Parameters:
dimension-- Returns:
- length of
dimension - Throws:
java.lang.IllegalArgumentException- ifdimensionis not a dimension of the array
-
getNumberOfDimensions
public int getNumberOfDimensions()
Returns the number of dimensions of the array.- Returns:
- number of dimensions
-
-