Shrink jit.matrix based on cell contents?

Oct 21, 2013 at 5:21am

Shrink jit.matrix based on cell contents?

Hey,

I’m looking for a way to shrink a jitter matrix based on cell contents. I have a very large matrix right now and I wold like to remove any cell that is equal to “0 0″. That means that the matrix would go from being larger than 100 x 100 to a variable size that is based on the number of cells that contain a value. I’m obviously not interesting in maintaining cell position, but I’m only interested in a list of the data contained in the cells.

Thanks for your help!

#268590
Oct 21, 2013 at 8:33am

On second thought, I just found the jit.spill object, which can only print out a pretty small list. Is there a way to restrict the matrix data before jit.spill so that jit.spill will only receive and output cells with a value != 0 ?

#268619
Oct 21, 2013 at 2:05pm

This may work for you.

<code>

– Pasted Max Patch, click to expand. –

</code>

#268670
Oct 21, 2013 at 2:17pm

If you want to get around the list length issue, you can use jit.iter

<code>

– Pasted Max Patch, click to expand. –

</code>

#268674
Oct 21, 2013 at 4:41pm

Awesome! Great call on ‘jit.iter’, totally missed that. Thanks for the examples, this is exactly what I was looking for.

#268685

You must be logged in to reply to this topic.