Why are you writing row0
and ncol
in quotes? Just divide row0
by ncol
to get the result.
ncol = length(indpic(1,:)); % ncol = 32
row0 = sum(indpic == 0,2); % 161 * 1 matrix
rowprob0 = row0/ncol %or row0./ncol, doesn't make a difference when dividing by a scalar