Generally speaking, measure the time for a calculation on a matrix m x m, then for one a*m x a*m, then b*m x b*m. If the calculation is linear in m, then the time for the first should be m^2*C1+C2 for constants C1 and C2, and the time for the middle should be a^2*m^2*C1+C2 and that is enough information to solve for C1 and C2. Use those to make a prediction for b*m. Was the third time close to that? If so then the time is approximately linear in m^2. Or quadratic in m, depending on how you want to look at it.
Now if the times are not predictive for b*m then change your model ffrom ^2 to ^n for unknown n, and write out the math for m, a*m, and b*m. Three unknowns, three equations, and you can proceed to estimate n. You can cross-check with a fourth test.