Calculates a matrix constrained within a range.