DIAdem Help

Content Type
Programming Language
Current manual
Table of Contents

Command: MatTranspose

Display all  Hide all

Command: MatTranspose

Transposes rows and columns in a matrix.

Set ChnResult = MatTranspose(X, Y, ChnList, ResultChannel, ResultChannel, [MatTransIP])

Input Parameters

X Specifies the data channel containing the x-values.
Y Specifies the data channel containing the y-values.
ChnList Specifies one or more channels.
ResultChannel Specifies the result channel containing the x-values of the transposed matrix.
ResultChannel Specifies the result channel containing the y-values of the transposed matrix.
[MatTransIP] Specifies whether DIAdem overwrites the values of the input channels with the transposition result values. The default value is False which specifies that DIAdem does not overwrite the input channels.

Return Parameters

ChnResult Contains two result channels with the x- and y-values of the transposed matrix. DIAdem always saves the z-channels in the default group. ElementList <Data> type return value.

The ChnList variable contains the data channels that span the z-matrix.

Note  The number of rows of the z-matrix must correspond to the length of the x-channel and the number of columns of the z-matrix must correspond to the length of the y-channel. If not, DIAdem uses the maximum possible dimension for the calculation.
Refer to the Help page 3D Basic Functions for further information.

Examples

The following example swaps the columns and rows of a matrix and saves the result channels in the Results channel group. The input channels are accessed through channel objects.

VBScriptPython

 

Dim oMyXChannel, oMyYChannel, oMyChannelList, oMyResultChn
Set oMyXChannel = Data.Root.ChannelGroups(2).Channels(1)
Set oMyYChannel = Data.Root.ChannelGroups(2).Channels(2)
Set oMyChannelList = Data.GetChannels("[2]/Z*")
If Not(Data.Root.ChannelGroups.Exists("Results")) Then Data.Root.ChannelGroups.Add("Results")
Data.Root.ChannelGroups.Item("Results").Activate
Set oMyResultChn = MatTranspose(oMyXChannel, oMyYChannel, oMyChannelList, "Results/TransposedMatrixX", "Results/TransposedMatrixY", False)
Call MsgBox("Result channel(1): " & oMyResultChn(1).ChannelGroup.Name & "/" & oMyResultChn(1).Name & VBCrLf &_
            "Result channel(2): " & oMyResultChn(2).ChannelGroup.Name & "/" & oMyResultChn(2).Name)

The following example swaps the columns and rows of a matrix and saves the result channels in the Results channel group. You access the x- and y-input channels through the channel reference and the z-input channels through channel objects.

VBScriptPython

 

Dim oMyResultChn, oMyChannelList
Set oMyChannelList = Data.GetChannels("[2]/Z*")
If Not(Data.Root.ChannelGroups.Exists("Results")) Then Data.Root.ChannelGroups.Add("Results")
Data.Root.ChannelGroups.Item("Results").Activate
Set oMyResultChn = MatTranspose("[2]/[1]", "[2]/[2]", oMyChannelList, "Results/TransposedMatrixX", "Results/TransposedMatrixY", False)
Call MsgBox("Result channel(1): " & oMyResultChn(1).ChannelGroup.Name & "/" & oMyResultChn(1).Name & VBCrLf &_
            "Result channel(2): " & oMyResultChn(2).ChannelGroup.Name & "/" & oMyResultChn(2).Name)

Dialog Box Call

Call SUDDlgShow("Main", ResourceDrv & "AnaMatTransp")

Transpose matrix

Related Topics

Command: ChnConvexHull | Command: ChnD3Appr | Command: ChnD3Interp | Command: ChnD3InterpPoint | Command: ChnIsolinesCalc | Command: ChnMatConvert | Command: ChnNConvexHull | Command: MatAdd | Command: MatAppend | Command: MatChnConvert | Command: MatD3Appr | Command: MatD3Interp | Command: MatD3InterpPoint | Command: MatDiv | Command: MatExtremeValues | Command: MatIntegrate | Command: MatIsolinesCalc | Command: MatMul | Command: MatNormalize | Command: MatRelativize | Command: MatScalAdd | Command: MatScalMul | Command: MatSort | Command: MatSub | Command: MatSum | Command: MatVAlgebr | Command: MatVColumn | Command: MatVRow | Command: SubMat

Was this information helpful?