It's clear that the algorithm needs at least O(N^2) because to access each element of the matrices once, you need a double for loop, which is O(N^2).
for i in rows
for j in cols
# do something with element matrix1 [i, j], matrix2[i, j],...
so it has to be j >= 0