Playing sound in left and right speaker alternatively and storing output in array in matlab I have a play function that is called twice, each plays a channel (a column of the two dimensional array) in both speakers. What I am trying to do  is to play both channel at the same time. How do I silence a channel and set the  the elements in the corresponding column to 0. I also need an output array that im trying to make look like this when the data is output into it. The code is in the link below. 
1     0
2     0
1     0
0     4
0     1
0     1

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);

%Sound 1 
sound(sound_array(:,1), Fs);
%Sound 2
sound(sound_array(:,2), Fs);
%Play Consecutive
sound(sound_array, Fs);
If you want to play only one channel then you must set zeros at one of your matrix columns, i.e.:

sound_L = sound_array;
sound_L(:,2) = 0;

sound_R = sound_array;
sound_R(:,1) = 0;


So your code becomes:

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;  

%Sound 1 
sound(sound_L, Fs);
%Sound 2
sound(sound_R, Fs);
%Play Consecutive
sound(sound_array, Fs);