ONLINE HELP WINDEV, WEBDEV AND WINDEV MOBILEVersion: 2425262728
 Home | Sign in | English
 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…
 Comments
 Click [Add] to post a comment
 Last update: 05/26/2022Send a report | Local help
 Registered trademarks. Copyright ©2009-2022 PC SOFT. All rights reservedThis website has been developed with WEBDEV and HFSQLWEBDEV, WINDEV Mobile and WINDEV programming