MATLAB: Can someone explain to me what is this entire code means

pipelined adc

ptotdB = dbp(ptot);
in another file:
function y=dbp(x)
y = -Inf*ones(size(x));
nonzero = x~=0;
y(nonzero) = 10*log10(abs(x(nonzero)));

Best Answer

Looks like it's converting any non-zero input to decibels ( http://en.wikipedia.org/wiki/Decibel ), and zero input to negative infinity.