Adding lists individually, not sum

Jan 19, 2013 at 4:26pm

Adding lists individually, not sum

Ex, I have 4 lists:
1 0 0 0 1 0 0 0
1 0 1 0 1 0 1 0
1 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1

i want to add the numbers “by column” so for this example it would be:
4 1 2 1 3 1 2 1

right now my solution involves splitting each list and adding them separately which involves a lot of objects (iter, count indexing, route, thresh, zl sum). Is there a more elegant way to do this?

#58286
Jan 19, 2013 at 4:32pm

Hi,

With [vexpr] :

– Pasted Max Patch, click to expand. –
#209383
Jan 19, 2013 at 4:52pm

perfect! since getting into list processing i’ve learned a bunch of new objects. haven’t used vexpr before. thanks for the help!

#209384

You must be logged in to reply to this topic.