How to implement Viola-Jones algorithm in Matlab?
Somebody did it for you:


Viola-Jones Face Detection for Matlab
Viola Jones Object Detection 


and I guess you can find a few others. A nice description, in pseudo-code, can be found in An Analysis of the Viola-Jones Face Detection Algorithm, IPOL, 2014, which you can follow to code your own.