elementDivide method
Divides the corresponding elements of this matrix by the elements of the given matrix.
other
: The matrix to element-wise divide with this matrix.
Returns a new matrix containing the result of the element-wise division.
Example:
var matrixA = Matrix([[2, 4], [6, 8]]);
var matrixB = Matrix([[1, 2], [3, 4]]);
var result = matrixA.elementDivide(matrixB);
print(result);
// Output:
// 2 2
// 2 2
Implementation
Matrix elementDivide(Matrix other) {
return elementWise(other, (a, b) => a / b);
}