From the course: Mathematica 11 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Perform element-wise calculations

Perform element-wise calculations - Mathematica Tutorial

From the course: Mathematica 11 Essential Training

Start my 1-month free trial

Perform element-wise calculations

- [Instructor] Earlier in this chapter, I showed you how to perform matrix multiplication. In this movie, I would like to show you how to perform element wise calculations. Remember that matrix multiplication requires that the first matrix have a number of columns that is equal to the number of rows in the second matrix. That means the matrices can be of different shapes. If you want to perform an element wise calculation, then you can multiply the values of one matrix with the values of another, but in this case, the matrices need to be the same shape. I have opened a blank Mathematica notebook, so I need to enter in a couple of matrices. I'll assign the first one to the variable mat3, followed by the equal sign. To enter it in visually as opposed to a list of lists, I'll go to the insert menu, point to table matrix, and click new. I'll make this a two by three matrix, that is with two rows and three columns, so I'll make sure make sure that the matrix option is selected, and I'll…

Contents