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.

Sort and reorder lists

Sort and reorder lists - Mathematica Tutorial

From the course: Mathematica 11 Essential Training

Start my 1-month free trial

Sort and reorder lists

- [Instructor] List of values provide a lot of important information. You can get further information by sorting lists either in ascending or descending order, or reversing a list that you have already created. In this movie, I will show you how to sort your list, how to reverse its order, and also how to pad or expand a list so it has the exact length that might be required for some calculations. I've opened a blank Mathematica notebook, so I need a list of values to work with. So I will start by creating a list called hlist, equals, then a left curly bracket and then the value's one, eight, seven, one, two, six, another comma, and then the last three values, three, five, four. Then a right curly bracket to close the list definition and Shift + Enter and my list is in place. If you want to sort the values in your list, you can do that using the Sort command and you can either go in ascending order or descending order or as Mathematica calls it, Greater, which puts the highest values…

Contents