There is / are some classes on Coursera in Bayes Nets and probabilistic models which use Matlab, and they have free trial periods, and some of them are free to take the class. They have some partially completed code examples.
Most of the Stanford courses use Matlab/Octave, so you should be able to find simple examples.
There's also a book on Bayes for ML by David Barber that has algorithms and links to code, free pdf download from his web site.
Naive Bayes is simple enough that it may be easier to write your own than it is to figure out someone else's code.
See this link to free download on DB web site, also you may find his other work helpful: