Content Prev Next Down

Transferring Data to SigmaPlot
Syntax spput()
spput(dataMatrix)
spput(dataMatrixrowIndexcolumnIndex)
See Also spget , spsection , spitem , spopen , spmacro

Description
Transfers O-Matrix data to SigmaPlot. If the function spput is called without arguments all data in the current SigmaPlot worksheet is cleared. The argument dataMatrix may be any non-complex valued O-Matrix variable or expression.

If spput is called with one argument, dataMatrix is transferred to the current SigmaPlot worksheet starting in row 1, column 1. If present, the arguments rowIndex and columnIndex must be integer scalars that specify the starting row and column index for dataMatrix.

Examples

Transferring Numeric Data
If SigmaPlot is not running and you enter the following at the O-Matrix prompt
     clear
     spopen
     x = fillcols(1:1:6, 4)
     spput(x)
SigmaPlot will start and create a worksheet containing the values from x


If you continue the example above by entering the following at the O-Matrix prompt
     spsection("NewNumericSection")
     v = 1: 0.5 : 5
     spput(v*v')
SigmaPlot will create a new section and worksheet that looks like


Specifying the rowIndex and columnIndex can be used to overwrite a portion of an existing worksheet. If you continue the example above by entering
     spsection("Section 1")
     spput({[100, 100], [100, 100]}, 3, 2)
SigmaPlot will make the worksheet in Section 1 the current worksheet and the data will now look like

Transferring Non-Numeric Data
Character-valued expressions are transferred to a single column of a SigmaPlot worksheet. Each row of the O-Matrix character value is transferred to a single cell. If SigmaPlot is not running and you enter the following at the O-Matrix prompt
     clear
     spopen
     spsection("CharMatrixData")
     text = {"Hi", "World"}
     spput(text, 1, 2)
SigmaPlot will start and create a new section and worksheet. Row one of text, will be transferred to cell (1,2) of the new worksheet and the second row of text will be transferred to cell (2,2) of the new worksheet.


O-Matrix logical-valued expressions are converted to integers before transferring to SigmaPlot. If you continue the example above by entering
     spsection("LogicalData")
     spput({[true, false], [false, true]})
SigmaPlot will create a new section, LogicalData and your notebook will now look like