Hi there,
Please take a look at this video: Speed Control of a DC Motor Using PWM . I think it shoudl help you do exactly what you are trying to do.
Arkadiy Turevskiy MathWorks
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!