Getting a specific value from a matrix

ardaksoy's icon

Hi,

I am trying to get all the 0 values from one matrix and write them to another matrix. I am sure there is an easy way to do this but I could not figure it out.

Thanks.

vichug's icon

you could do something like [jt.expr @expr if in[0] == 0 then 0 else 1]
but you'll have to htink what you want to fill teh rest of your matrix with (i assumed 1 here), cause you can't create an incomplete matrix, you must fill all its cells at once.

ardaksoy's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I tried it but couldn't make it work. Probably I am doing something wrong.

ardaksoy's icon

Oh, nevermind. [jit.gen bool] seems to work.

loadmess's icon

Hi all!
I'm looking for a similar solution, but instead I need to create a new matrix filled only with the non-zero values. The new matrix should have different dimensions of the source matrix.
Any tips on how to achieve this without leaving the jitter world?