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.

Generate useful matrices

Generate useful matrices - Mathematica Tutorial

From the course: Mathematica 11 Essential Training

Start my 1-month free trial

Generate useful matrices

- [Instructor] For some machine learning and other applications, you'll find it useful to create specific matrices. For example, a matrix that contains only the number zero, another that contains only the number one, or a matrix that has the number one from the top left to the bottom right diagonal in a square matrix. In this movie, I will show you how to create each of those matrices in Mathematica. I have created a blank Mathematica notebook, and I can run through the commands of creating the three different types of matrices that I described. The first is a matrix that consists entirely of ones. To create that, I need to use the constant array keyword. So I'll type ConstantArray. The A at the beginning of array is capitalized. Now enter a left square bracket to start my argument list. I want the constant in the array to be the number one; so I'll type one, then a comma. Now I need to enter in a list to identify the dimensions of the matrix, that is the number of rows and columns…

Contents