How to add repeated beeps to sound created with a pause in between each beep in MATLAB I have 2 sounds that I created and trying to make them beeps. Maybe 4 or 5 repeated beeps but have a pause in between each beep but make it still part of the signal. I think I have it so that the sound is a single frequency but just need make it a repeated with pauses and still part of the same signal. Any help would be appreciated I have the code listed below.

Fs = 44100;
N = 400;
t = (1:N)*(1/Fs);
freq = 600;

sound_array = zeros(N, 2);
%starts N x 2 matrix
sound_array(:,1) = sin(2*pi*freq*t);
sound_array(:,2) = sin(2*pi*freq*t);

%Left and Right channels

sound_L = sound_array;
sound_L(:,2) = 0;
sound_R = sound_array;
sound_R(:,1) = 0;
plot(sound_array);

%Sound 1
sound(sound_L, Fs);
%Sound 2
sound(sound_R, Fs);
%Play consecutive
sound(sound_array, Fs);
Any pause can be done by using vector/matrix concatenation. Let's say you want to make a signal with pause of length P after it, then do the following:

P = 400;
beep = [sound_array; zeros(P, 2)];


Now if you want to make arbitrary number K of your beeps then use the repmat function as follows:

K = 5;
beeps = repmat(beep, K, 1);


Please read more about matrix concatenation here if you wish.

I believe that with your current code, because you use sound function, signals will be played at the same time. I suggest you to use the pause function to separate playbacks, i.e.:

sound(...)
pause(1)
sound(...)


To create a 1 second pause between playback starts.