function xx = fsk_gen( bitstr, fs, bdur) len_bitstr = length(bitstr); num_array = abs(bitstr); bin_string = DEC2BIN(num_array,8); len_binstr = length(bin_string); k = len_binstr * len_bitstr; reshape(bin_string,1,k); inbits = abs(bin_string) - abs('0'); % convert string to array of binary numbers xx = []; tvec = [0:fs*bdur]/fs; % determine time interval %% Determine the frequency to output from the array of binary numbers for i = 1:length(inbits) if (inbits(i) == 1) xxp = 1650; elseif (inbits(i) == 0) xxp = 1850; else 'error' end xx = [xx zeros(1,fs/50000)]; %<- this is line 43 xx = [xx cos(2*pi*xxp*tvec)]; end specgram(xx,[],fs) soundsc(xx,9000) This function is running EXACTLY as i wish it to; however i am getting the following message: Warning: Size vector should be a row vector with integer elements. > In fsk_gen at 43 Any ideas? thanks!