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 - Mathematica Tutorial
From the course: Mathematica 11 Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Create a list2m 42s
-
(Locked)
Refer to and edit list items5m 29s
-
(Locked)
Add and delete list items4m 27s
-
(Locked)
Count and summarize list items5m 14s
-
(Locked)
Sort and reorder lists4m 36s
-
(Locked)
Identify the first or last item in a list1m 44s
-
(Locked)
Select list items by rule4m 20s
-
(Locked)
Delete duplicate list items2m 15s
-
(Locked)
Join multiple lists into a single list4m
-
(Locked)
-
-
-
-
-
-