 Help WLanguage WLanguage functions Standard functions Numeric values management functions Matrix functions MatMultiply (Example) Multiplying two matrices  MatAdd (Example) MatAdd MatCopy (Example) MatCopy MatCreate (Example) MatCreate MatDelete (Example) MatDelete MatDeterminant (Example) MatDeterminant MatError (Example) MatError MatExist (Example) MatExist MatFill (Example) MatFill MatFloatAdd (Example) MatFloatAdd MatFloatMultiply (Example) MatFloatMultiply MatInvert (Example) MatInvert MatMultiply (Example) MatMultiply MatNbColumn (Example) MatNbColumn MatNbLine (Example) MatNbLine MatRead (Example) MatRead MatReadColumn (Example) MatReadColumn MatReadLine (Example) MatReadLine MatStack (Example) MatStack MatTranspose (Example) MatTranspose MatWrite (Example) MatWrite Matrix management functions The matrices
 Multiplying two matrices MatMultiply (Example)See the associated help page Multiplying two matrices The following code is used to multiply two matrices.We assume that the matrices are already created. The existence of the matrices is checked by MatExist. The number of columns in the 1st matrix must be equal to the number of rows in the 2nd matrix. // -- Click code on BTN_Multiplication// Declare the variablesResMultiply is boolean// Checks the existence of the matricesIF MatExist("Matrix1") = True AND MatExist("Matrix2") = True THEN // Nb. columns in the 1st matrix = Nb. rows in the 2nd matrix? IF MatNbColumn("Matrix1") = MatNbLine("Matrix2") THEN // Multiply the two matrices ResMultiply = MatMultiply("Matrix1", "Matrix2", "MatrixResult") IF ResMultiply = True THEN Info("The multiplication was performed") ELSE // Display the error message Error(ErrorInfo(errMessage)) END ELSE   Info("The number of columns is not equal to the number of rows") ENDELSE   Info("The matrices do not exist")END Minimum version required Version 9 This page is also available for…