multiply arrays javascript
var sum = 0;
for(var i=0; i< arr1.length; i++) {
sum += arr1[i]*arr2[i];
}
multiply arrays javascript
var sum = 0;
for(var i=0; i< arr1.length; i++) {
sum += arr1[i]*arr2[i];
}
matrix multiplication javascrpt
function multiplyMatrix(matrixA, matrixB)
{
var result = new Array();//declare an array
//var numColsRows=$("#matrixRC").val();
numColsRows=2;
//iterating through first matrix rows
for (var i = 0; i < numColsRows; i++)
{
//iterating through second matrix columns
for (var j = 0; j < numColsRows; j++)
{
var matrixRow = new Array();//declare an array
var rrr = new Array();
var resu = new Array();
//calculating sum of pairwise products
for (var k = 0; k < numColsRows; k++)
{
rrr.push(parseInt(matrixA[i][k])*parseInt(matrixB[k][j]));
}//for 3
resu.push(parseInt(rrr[i])+parseInt(rrr[i+1]));
result.push(resu);
//result.push(matrixRow);
}//for 2
}//for 1
return result;
}// function multiplyMatrix
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us