In reply, the tourists were 60 for no loss when stumps were drawn, with Dimuth Karunaratne unbeaten on 28 and Kaushal Silva on 30.
Earlier, Shaminda Eranga picked four wickets and his new-ball partner Suranga Lakmal claimed three.
Mathews took the other wicket to fall to the pacers.
Bangladesh lost four wickets in the morning before captain Mushfiqur Rahim (61) and all-rounder Shakib Al Hasan (55) stitched together an 86-run stand for the fifth wicket.
Left-hander Shakib's attacking innings came to an end when he was trapped leg before by left-arm spinner Rangana Herath, who took two wickets.
Bangladesh also lost Nasir Hossain (four) in the next over as they were reduced to 150 for 6.
Mushfiqur then combined with Sohag Gazi (42) in a 53-run partnership for the seventh wicket before the former was trapped leg before by Lakmal.
Bangladesh handed a Test debut to 25-year-old opening batsman Shamsur Rahman, who made 33.
Sri Lanka wicketkeeper Prasanna Jayawardene was a last-minute withdrawal due to the death of his father, Dinesh Chandimal taking the gloves for the visitors.
Scorecard
Bangladesh (1st innings):
Tamim Iqbal c Lakmal b Eranga 6
Shamsur Rahman c Vithanage b Eranga 33
Marshall Ayub lbw b Mathews 1
Mominul Haque c Vithanage b Lakmal 8
Shakib Al Hasan lbw Herath 55
Mushfiqur Rahim lbw Lakmal 61
Nasir Hossain c Chandimal b Eranga 4
Sohag Gazi c Eranga b Lakmal 42
Robiul Islam c Perera b Eranga 5
Rubel Hossain b Herath 2
Al-Amin Hossain not out 6
Extras: (LB-4, NB-5) 9
Total: (all out, 63.5 overs) 232
Fall of wickets: 1-35, 2-40, 3-40, 4-59, 5-145, 6-150, 7-203, 8-219, 9-222.
Bowling: Lakmal 18.1-3-66-3, Eranga 17.4-2-49-4, Mathews 6-3-18-1, D Perera 11-2-45-0, Herath 11-1-50-2.
Sri Lanka (1st innings):
D Karunaratne not out 28
K Silva not out 30
Extras: (W-1, NB-1) 2
Total: (For no loss; 19 overs) 60
Bowling: Robiul 4-1-12-0, Al-Amin 5-1-18-0, Rubel 4-0-20-0, Gazi 5-2-8-0, Shakib 1-0-2-0.
Image: Sri Lanka's Suranga Lakmal bowls as Bangladesh's captain Mushfiqur Rahim (left) watches during the first day of the first Test in Dhaka.
Photograph: Andrew Biraj/Reuters
Sharjah Test: Azhar, Misbah steer Pakistan to dramatic win over Lanka
Misbah misses ton as Pakistan tail frustrates Sri Lanka
Dubai Test: Sri Lanka win to go 1-0 up against Pakistan
Pakistan strike early but Sri Lanka extend lead to 220
Shehzad hits maiden Test ton but Pakistan's hopes fade