In the second code snippet, instead of:
set matrix tile 1,x,y,x*y
use:
set matrix tile 1,x,y,(x+y*Maxx)+1
Where Maxx is the highest x can go and plus 1 because that start value is 0. So Maxx=50
OR
in the first code snippet, instead of:
rem make a matrix and texture
load image "image.bmp",1
make matrix 1,1000,1000,50,50
prepare matrix texture 1,1,50,50
t=0
for x=0 to 49
for y=0 to 49
inc t
set matrix tile 1,x,y,t
next y
next x
use:
rem make a matrix and texture
load image "image.bmp",1
make matrix 1,1000,1000,50,50
prepare matrix texture 1,1,50,50
t=0
for y=0 to 49
for x=0 to 49
inc t
set matrix tile 1,x,y,t
next x
next y
I swapped the x and the y for loops around because the texture is numbered from left to right. For example (in a 3x3 grid):

Did you know - 12% of Americans believe Joan of Arc was Noah's wife.