This should be fairly simple. Create an array for your x values (sawtooth) and y (ramp). Create an empty 2D array. Create a for loop and wire the x and y array to the for loop. Disable indexing for the y array. Create an inner for loop and wire the x and y to the inner loop (the x will be a single value).
Create shift registers on both loops and wire the empty 2D from outside, to the outer loop, and then from the outer loop to the inner.
Also wire the z array (which needs do be either indexed relative to the x and y array or the x and y array element values depending on your application).
You can now use the replace array subset inside of the inner most loop to build up your 2D array (wire the output through the shift registers).
I hope this hel
ps!