One key point is to understand that step motors aren't regular dc motors, they need to be pulsed with a sequence off signals to rotate, Your mat lab program must define how many steps you want the motor to rotate, acording to this your pic device will put the correct sequences off pulses on the motor passing by a power bridge, Step motor's dont turn on, they act on pulses, while the pulses are there on a correct sequence they will turn to one or another side ( accordinng to the sequence ), as sons as the pulses stop, the motor will stop imediately.
Take a look on those links
**broken link removed**
**broken link removed**
Regards
Carlos