Learn R Programming

tropAlgebra (version 0.1.0)

matrixMultiply: Tropical Product of Matrices

Description

This function returns the product of two matrices. Keep in mind that Rows of 1st matrix must be eqaual to columns of 2nd one.

Usage

matrixMultiply(x,y)

Arguments

x

A numeric Matrix

y

A numeric Matrix

Value

Returns the tropical product of x and y

Details

e.g. [1] [2] [1] 2 3 1st matrix that is X [2] 5 7 [1] [2] [1] 6 3 2nd matrix that is Y [2] 1 9 Now, calling function... matrixMultiply(X,Y) Then Tropical sum of Matrices will be...

[1] [2] [1] 3 5 Resultant Matrix [2] 8 8

Examples

Run this code
# NOT RUN {
 x<-matrix(c(2,3,5,7),ncol=2,nrow=2)
y<-matrix(c(6,3,1,9),ncol=2, nrow=2)
  matrixMultiply(x,y)
# }

Run the code above in your browser using DataLab