Specify number of additional times queued data is output
Note: You cannot use the legacy interface on 64-bit MATLAB®. See Working with the Session-Based Interface to acquire and generate data on a 64-bit MATLAB.
To send data to an analog output subsystem, it must first be queued in the data acquisition engine with the putdata function. If you want to continuously output the same data, you can use multiple calls to putdata. However, because each putdata call consumes memory, a long output sequence can quickly bring your system to halt.
As an alternative to putdata, you can continuously output previously queued data using RepeatOutput. Because RepeatOutput requeues the data, additional memory resources are not consumed. While the data is being output, you cannot add additional data to the queue.
AO, common to all channels
Read-only when running
Create the analog output object ao for a sound card and add one channel to it.
ao = analogoutput('winsound'); chans = addchannel(ao,1);
To queue one second of data:
data = sin(linspace(0,10,8000))'; putdata(ao,data)
To continuously output data for 10 seconds:
ao.RepeatOutput = 9