From: Michael Purdy on
Is there some way to pause for a millisecond or less? The pause(n) function only allows for a pause of 0.01s. I am sending data to a piece of hardware and need it to be sent at a variable frequency between 100Hz and 250Hz. This calls for a pulse width of 2ms to 5ms, so I need to be able to pause for this long at the very longest.
Thanks for your help.
Michael
From: Matt Fig on
This seems to me to be a pretty good way to pause for a given amount of time. You can put this line in between calls.

tic,while toc<.003,end % Run for less than 3 ms
toc % Not part of pausing code above, just check total time.

This method does have some vulnerabilities, but I am not sure how to do better.