Element-wise operations

FCC link

Implement basic element-wise matrix-matrix and scalar-matrix operations.

Implement:

  • addition
  • subtraction
  • multiplication
  • division
  • exponentiation

The first parameter will be the operation to be performed, for example, "m_add" for matrix addition and "s_add" for scalar addition. The second and third parameters will be the matrices on which the operations are to be performed.

Test

{{test}}

Console output