function total = countzeroes(k) % k is a 1xn row containing, possibly, some zeroes. This function returns the number of % zeroes in the row % counts zeros in row k % Created by Jim Work, University of South Carolina, August 13, 2003 count =0; n = size(k,2); n for i = 1:n if k(i) == 0 count = count +1; end end total = count;