See the PLECS documentation for a demo model called "Grid-Connected Single-Phase Solar Inverter", which implements MPP tracking. Also, read the documentation on C-Scripts and try easier examples before attempting to implement an MPP tracker.
This should get you started.