Matthew lifted a hand up gently petting Nao's head, because he thought she might be upset. So he wanted to help her feel better, and this was the only way he really knew how.