The 23-year-old had a successful spell with Portsmouth last season on loan from Cardiff City, where he made over 30 appearances, but he was released by the Welsh club earlier in the summer.
The winger started his career at Rugby Park but was soon picked up by Everton. He didn’t make an appearance for the Toffees and was loaned out to Tranmere, MK Dons and Hibernian.
He made 13 appearances for Hibs in the Championship, scoring one goal, before being signed by Cardiff. Further loan spells followed and he became a mainstay in the Portsmouth side that narrowly missed out on the play-offs in League Two last season.
Tommy Wright was keen to add a winger to his squad and told the club website of his delight at the deal.
“This is a really exciting signing for the football club and I’d like to thank the chairman for pushing this one through so quickly because there was a lot of interest being shown in Matty from other clubs.
“I think this is a real coup for us. I’m delighted to have him here and I think along with drey Wright on the other flank we have a real potent threat in the wide areas for the season ahead.
Matty has had a good career down in England and has impressed during his loan spells too.”