The problem is that you are not using the index N.
A = (Array(1,1)*Z)/Array(1,2);
This line doesn't change, so you will get the same output 15 times. A nested loop would look like this:
[row,col] = size(B);
for N = 1:col
for M = 1:row
A = (B(M,N)*Z)/B(1,2);
The first loop will start at column 1, then the second loop goes through all rows. After that it repeats with column 2 and so on if you have more columns. Depending on how you want to manipulate the entries you have to use both indexes accordingly.