There are countless options for doing this and your problem appears to be fairly general purpose. Take a look at this information page on the topic.
Paul Shoemaker
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!