I feel a little stupid as I am sure I covered this in my algebra classes on numerous occasion when I was younger, but I am struggling to find the formula that allows cell addressing in a matrix. For example, how do I find the cell number for the cell that is on column 5, row 4 of an 8x8 matrix ?
Any help would be greatly appreciated. If you need more clarity, let me know.
for (row = 0 to 7)
for (column = 0 to 7)
matrix[row, column]=row*7 + column;
nextcolumn
next row
for (row = 0 to 7)
for (column = 0 to 7)
value = matrix[row, column]
Serial.print (value)
nextcolumn
next row
Is it Pascal? In C different syntax, but the idea is clear.
Thanks so much Bill (and all), this is precisely what I was after. And yes, it's so logical that I feel really stupid. I was making it much more difficult on myself.
In regards to why I would need this, it pertains to the output that I need to address (being an x by x matrix that is addressable via numbers 0 -< total, in my case, 64). The conversation was great here though and it really made me realise that I need to read up on multidimensional arrays a bit. They seem like they could come in real handy!