Would keep an eye on http://matlab-ib-trading.blogspot.com/ for future topics of interest. Might develop into decent source. Might be helpful...basic... http://tradingwithmatlab.com/intradaydataIB.html Has a few helpful tips/code: http://tradingwithmatlab.blogspot.com/
Did you already pay for Matlab? Have you ever used R? Sorry I can't help with the IB-connection code.