Hi sapanssonar,
I have studied this topic long time ago, so i can't give you any code for now, but i have a suggestion for you.
I saw a book which has got extensive analysis of Matched Filters in fact the whole process of demodulation using matched filters was comprehensively described in this book below
Contemporary Communication Systems using Matlab - Proakis and Salehi
The description was accompanied by several matlab codes which help in understanding the topic as well as coding our own matched filter using matlab, i used to have this book long time ago but i don't have it now.
I hope this helps -- Good Luck.