Create a repeating matrix
Hi,
I am trying to create a @planecount 1 @dim 1584 matrix where each 3 cell in sequence has the same random value. Something like:
value0, value0, value0, value1, value1, value1, value2, value2, value2, ...
I tried resizing the matrix without any interpolation, but it offsets at some point : the last value is not listed three times. Here is the code that shows the problem:
This is a solution (for a final @dim 15), but there must be a better way!
This doesn't address your question of why the resizing doesn't work as you expect, but here's a way of filling the matrix using uzi.
I was hoping to find a 1 or 2 object solution.
The biggest «speed hump» in dataflows is the number of messages per operation.
The anomaly is due to some precision issues when upsampling the matrix. If you want exactly three repetitions, here are 2 options, one using jit.multiplex, the other jit.coerce: