Lists

Overview

You can make lists in Desmos using square brackets like this:


You can create lists with evenly spaced elements. [1,...,10] is a list of the integers between 1 and 10. [1,3,...,11] is a list of the odd integers between 1 and 11. Table columns are available as lists in the rest of the system.

You can use lists anywhere in expressions that you would use a number. 

 

More Resources

Have more questions? Submit a request

14 Comments

  • 1
    Avatar
    Abotting213

    What is the maximum length of a list? May I have 16,000 elements in it?

  • 2
    Avatar
    Kashi Yamagato

    Can I access an item of a specific index? Say I have a list (or a table) and I want the last item in the list. Is there a way to do this?

  • 2
    Avatar
    Team Desmos

    Kashi - you can find a certain number in a list like x1[3] will give the 3rd number in the x1 list. 

  • 2
    Avatar
    Aran Glancy

    Can you concatenate lists? For example, if I have a=[1,2,3,4] and b=[5,4,3,2,1] and I want to get c=[1,2,3,4,5,4,3,2,1] can I do something like c=a+b?   

  • 2
    Avatar
    Team Desmos

    Aran - not currently, but it's on our list!

  • 0
    Avatar
    MrYurihi redstone

    Can you get multiple entries from an list, like getting entries 2 to 6, but in one thing? If not, how could you get Quartile 1 and Quartile 3 from any given list?

    Edited by MrYurihi redstone
  • 0
    Avatar
    Kristin

    You can try something like this to reference certain elements in a list: https://www.desmos.com/calculator/zcyahozrpb

    Edited by Kristin
  • 1
    Avatar
    Bryan Garcia

    I made two original equations to go from binary to decimal and decimal to binary. The binary to decimal uses the lists feature in desmos. I was wondering if there was any way that I could make a number into a list so that I could just type in the number in a function I guess and use that list instead of putting a comma after every single digit in a 20 digits long binary string.

  • 0
    Avatar
    Serge Ballif

    Bryan Garcia, The trick is to use an intermediary list. I made an example that will convert a decimal whole number to a list of digits. You can modify it as needed. https://www.desmos.com/calculator/7dsepfo2pe

  • 0
    Avatar
    Serge Ballif

    MrYurihi redstoneYou can use the quantile function in the stats menu. To get Q1 and Q3 of a list A you would use the commands quantile(A,.25) and quantile(A,.75). You can even use the quantile function to sort a list. The worksheet https://www.desmos.com/calculator/rfgwycggun shows an example of a sorted list along with a method to concatenate lists or to get a sublist, 

  • 0
    Avatar
    Bombergere23

    Aran Glancy,

    see here for concatenating lists

  • 0
    Avatar
    Joe Quinn

    I have an equation with 2 parameters (say A and B) in it, and I want to show all the graphs with all combinations of A and B at integers from 1 to 10. If I put A=[1,...,10] and then B=[1,...,10], I only get the graphs for A ranging from 1 to 10 with B fixed at 1. How do I show combinations of choices for the two parameters?

  • 1
    Avatar
    Serge Ballif

    Joe. There are currently no methods for iterating over two lists as you requested. Instead, you could make two lists of length 100 to cover all the ordered pairs. The worksheet https://www.desmos.com/calculator/cg2i9poeub has an example showing how that might be done.

  • 0
    Avatar
    Joe Quinn

    Okay thanks. I had already done the thing you suggested.

Please sign in to leave a comment.
Powered by Zendesk