2.2.3.8 Matrix

Name

Matrix

Remark

An Origin C Matrix (upper case M) is a dynamically allocated and sized two dimensional array that is tied to an internal Origin matrix window. Matrix is a template class with a default type of double but a Matrix of any basic data type (including char, byte, short, word, int, uint and complex but not string) can be constructed using the syntax Matrix<type>. The Origin C Matrix class is used to access the data in an internal Origin matrix while the Origin C MatrixObject class is used for style related control of the matrix. Thus, the MatrixObject class has the same relationship with the Matrix class as the Column class has with the Dataset class. That is, an internal Origin matrix object (accessed by the MatrixObject class) holds a matrix data set (accessed by the Matrix class) just as a worksheet column (accessed by the Column class) holds a data set (accessed by the Dataset class). The data values displayed in the cells of an Origin matrix (referenced by a Matrix object) are typically referred to as Z values whose associated X values are linearly mapped to the columns of the matrix and whose associated Y values are linearly mapped to the rows of the matrix. The Matrix class is derived from the matrix and matrixbase classes from which it inherits methods and properties.

Hierarchy

Examples

EX1

int Matrix_ex1()
{
    // Assumes Matrix1 exists in Origin
    double dMean;
    Matrix matA;             // Declare OC Matrix object
    matA.Attach("MBook1");  // Attach OC object to internal Origin matrix
    dMean = matA.GetMean();  // Use matrixbase::GetMean function
    printf("Mean of Matrix1: %g\n", dMean ); // Print out mean
    return 0;
}

Header to Include

origin.h

Reference

Members

Name Brief Example
Attach Attach matrix object to internal Origin matrix Examples
Detach Detach a Matrix object from an internal Origin matrix. Examples
GetCellValue Get the value of the cell nearest the specified X and Y coordinates. Examples
GetInterpolatedValue Get an interpolated Z value from an internal Origin matrix. Examples
GetName Get the name of an internal Origin Matrix. Examples
GetXMax Get the X coordinate associated with the right most column of the matrix. Examples
GetXMin Get the X coordinate associated with the leftmost column of the matrix. Examples
GetXValue Get the X coordinate associated with the specified column of the matrix. Examples
GetYMax Get the Y coordinate associated with the last row of the matrix. Examples
GetYMin Get the Y coordinate associated with the first row of the matrix. Examples
GetYValue Get the Y coordinate associated with the specified row of the matrix. Examples
GetZRange Get the dynamic range (Z1, Z2) that is used in the data to image conversion. Examples
ImageLinesProfile Get intensity values over the course of a user defined path through this Matrix. Examples
IsValid Checks the validity of this Matrix. Examples
Matrix Default constructor for Matrix class. Examples
SetCellValue Set the value of the cell nearest the specified X and Y coordinates. Examples
SetXMax Set the X coordinate associated with the right most column of the matrix. Examples
SetXMin Set the X coordinate associated with the left most column of the matrix. Examples
SetYMax Set the Y coordinate associated with the last row of the matrix. Examples
SetYMin Set the Y coordinate associated with the first row of the matrix. Examples
SetZRange Set the dynamic range of this Matrix (Z1, Z2) that is used in data to image conversion. Examples
SetZRangeUpdate Enable or disable the automatic dynamic range (Z) update when Matrix data is changed. Examples
Update Update an Origin C Matrix object from an Origin matrix or vice-versa. Examples