# Multiplication

This type of multiplication is different from Matrix Multiplication in that the multiplication is done through each corresponding element.

Each index of the first matrix is multiplied by the same index of the second matrix, and put into a new matrix in the same position. Only matrices with the same dimensions can be multiplied this way.

.* | Scalar | Row Vector | Column Vector | Matrix |
---|---|---|---|---|

Scalar | Multiplies the two scalar values. | Multiplies the scalar with each element in the row vector. | Multiplies the scalar with each element in the column vector. The resulting vector is the same size as the original vector. | Multiplies the scalar with each element in the matrix. The resulting vector is the same size as the original matrix. |

Row Vector | Multiplies the scalar with each element in the row vector. The resulting vector is the same size as the original vector. | Requires the vectors to be the same size. Multiples each entity of the first vector and with the corresponding entity of the second vector. The resulting vector is the same size as the original vectors. | ||

Column Vector | Multiplies the scalar with each element in the column vector. The resulting vector is the same size as the original vector. | Requires the vectors to be the same size. Multiples each entity of the first vector and with the corresponding entity of the second vector. The resulting vector is the same size as the original vectors. | ||

Matrix | Multiplies the scalar with each element in the matrix. The resulting vector is the same size as the original matrix. | Requires the matrices to be the same size. Multiples each entity of the first matrix and with the corresponding entity of the second matrix. The resulting matrix is the same size as the original matrices. |

Examples

```
3.*3
ans = 9
4 .* [5 6 2]
ans = [20 24 8]
[8 6 7].*[5 3 0]
ans = [40 18 0]
```

Invalid Examples

`[2 5 1].*[7 ;5; 3]`