How do you make a list out of indexed list values

how to do this without the errors

this doesnt even work

Ridiculous!!

i basically want to do this

image

but for any number of times

to make sure im not misunderstanding:

are you trying to make a list of numbers, and another list, and the numbers of list b are the places in the list of list a?

wait nvm

////////////

To clarify, you want to stitch those four lists together into one large list?

[c_d[1], c_y[1], c_l[1], c_r[1], c_d[2], c_y[2], c_l[2], c_r[2],c_d[3], c_y[3], c_l[3], c_r[3]... etc.]

It’s not pretty, but here’s a solution.

Edit: Use the one below!

1 Like

I think recursion offers a clean solution:

https://www.desmos.com/calculator/vafusx18cy

2 Likes

Oh! And this was what I was trying to find in my brain! Similar to my first but more compact.

1 Like

That’s also very clean. I like it.

btw: the [i] can also be extracted …
https://www.desmos.com/calculator/5xeszj52ii

1 Like

Here’s a different approach if the lists have the same length:
https://www.desmos.com/calculator/rko1b0xtvs

1 Like

Kind of the inverse how I used the conditional mod(). I think I like this one best.

1 Like

In these situations one really would like to have lists of lists … or matrices.
Why is that Desmos decided not to have them? I understand that this simplifies compilers and internal structures because you need to deal with the nesting of lists … but on the other hand they seem really natural.

I’m not sure why they were never implemented in the graph. You can use them now in CL, and .reduce() them into a one dimensional array for use in the graph.