(defn count-out-consecutive
  [matrix starting-coords direction]
  (loop [coords starting-coords, counter 0]
    (if (= (get-in matrix coords) (get-in matrix starting-coords))
      (recur (mapv + coords direction) (inc counter))
      counter)))

(-> [[1  2  3]
     [4 nil 5]
     [6 7 nil]]
  (count-out-consecutive '(1 1) '(1 1)))