Addition and Scalar Multiplication in Machine Learning

Hritika Agarwal
2 min readJul 18, 2020

--

Addition and subtraction are element-wise, so you simply add or subtract each corresponding element. To add or subtract two matrices, their dimensions must be the same.

In scalar multiplication, we simply multiply every element by the scalar value. In the scalar division, we simply divide every element by the scalar value.

Experiment below with the Octave/Matlab commands for matrix addition and scalar multiplication. Feel free to try out different commands. Try to write out your answers for each command before running the cell below.

Well, the output of the above code will be-

--

--

No responses yet