SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 2 Vol 1

MATRIX TO VARIABLE

Name:
    MATRIX TO VARIABLE
Type:
    LET Subcommand
Purpose:
    Convert a matrix to a variable.
Description:
    There may be times when it is desirable to convert a matrix to a variable. This command provides a simple and convenient method for converting a matrix to a variable.
Syntax:
    LET <y> = MATRIX TO VARIABLE <m>
                      <SUBSET/EXPCEPT/FOR qualification>
    where <m> is the previously created matrix;
                <y> is the resulting response variable;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
    LET Y = MATRIX TO VARIABLE M
Note:
    By default, the variable is created in column order from the matrix. That is, column 1 of the matrix is extracted, then column 2 of the matrix, and so on. To create the variable in row order, enter the command

      SET MATRIX TO VARIABLE ROW

    To restore column order, enter

      SET MATRIX TO VARIABLE COLUMN
Note:
    It is also sometimes desirable to convert a variable to a matrix. This can be done with the command

      LET M = VARIABLE TO MATRIX Y

    where Y is a previously created variable.

Default:
    None
Synonyms:
    None
Related Commands: Applications:
    Data Management
Implementation Date:
    2010/11
Program:
     
    READ MATRIX M
    1 2 3
    4 5 6
    7 8 9
    END OF DATA
    .
    LET Y1 = MATRIX TO VARIABLE M
    SET MATRIX TO VARIABLES ROW
    LET Y2 = MATRIX TO VARIABLE M
    SET WRITE DECIMALS 1
    PRINT Y1 Y2
        
    The following output is generated
    ------------------------------
                 Y1             Y2
    ------------------------------
                1.0            1.0
                4.0            2.0
                7.0            3.0
                2.0            4.0
                5.0            5.0
                8.0            6.0
                3.0            7.0
                6.0            8.0
                9.0            9.0
     
        

Date created: 11/30/2010
Last updated: 11/30/2010
Please email comments on this WWW page to alan.heckert@nist.gov.