Mat 14:28-29 Peter said to Him, "Lord, if it is You, command me to come to You on the water." And He said, "Come!" And Peter got out of the boat, and walked on the water and came toward Jesus.
Yes, I did - and there are exceptions to that rule, too! :)
But seriously, you know that the Pharaoh also hardened his own heart. The Scriptures do not exclude Pharaoh from hardening his own heart, as well as God having something to do with it. Again, this is a mystery that I don't think we can explain - God's work of grace or lack of work in the reprobate.
As to Matthew, certainly, you will agree that God gave Peter the ability to walk on water??? Otherwise, Peter would have sank like a rock (sorry for the pun!) :)
Regards