Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Questions on the attached example
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
and have a question about it:
Before I put data to 'ao' they use:
data = zeros(4000,1);
why put zeroes to the entire vector? How is it possible that I able to hear any sound after zeroing 'data'?
Thanks,
0 Kommentare
Antworten (2)
Walter Roberson
am 12 Aug. 2012
The data being used there is example data. Initialize "data" to whatever contents you want (but make sure that it is within range for the device.)
0 Kommentare
Michael Adelman
am 12 Aug. 2012
2 Kommentare
Walter Roberson
am 12 Aug. 2012
The code example is
data = zeros(4000,1);
putdata(ao,data)
start([ai ao])
Here, "data" is being initialized to something, just for illustration purposes. You could have initialized to 1's or to pi or to 42 if you wanted:
data = 42 * ones(4000,1);
putdata(a0, data); %queue's the 42's
start(a0);
If you already have a vector, then use it:
putdata(a0, YourColumnVector);
start(a0);
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!