swapMatrix {tropAlgebra} | R Documentation |
Swap Matrices
Description
This function interchanges the values of both matrices.This function works only if both matrices are of same size.
Usage
swapMatrix(X,Y)
Arguments
X |
A matrix. |
Y |
A matrix. |
Details
If the size of both matrices are not same, it generates an error. This function swaps the matrices in memory(like pass by reference), it does not return the matrices, but interchanges their values.
Value
Swapped Matrix X
and Y
.
Examples
x<-matrix(c(2,3,5,7),ncol=2,nrow=2)
y<-matrix(c(6,3,1,9),ncol=2, nrow=2)
swapMatrix(x,y)
[Package tropAlgebra version 0.1.1 Index]