matrix multiplication javascript code example
Example: matrix multiplication javascrpt
function multiplyMatrix(matrixA, matrixB)
{
var result = new Array();
numColsRows=2;
for (var i = 0; i < numColsRows; i++)
{
for (var j = 0; j < numColsRows; j++)
{
var matrixRow = new Array();
var rrr = new Array();
var resu = new Array();
for (var k = 0; k < numColsRows; k++)
{
rrr.push(parseInt(matrixA[i][k])*parseInt(matrixB[k][j]));
}
resu.push(parseInt(rrr[i])+parseInt(rrr[i+1]));
result.push(resu);
}
}
return result;
}