To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016
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)));
No products are associated with this question.
Looks like it's converting any non-zero input to decibels ( http://en.wikipedia.org/wiki/Decibel ), and zero input to negative infinity.
This code finds log10 of the values of some vector (x). The line:
y = -Inf*ones(size(x));
is meaningless in this part of the code because it is overridden later by:
y(nonzero) = 10*log10(abs(x(nonzero)));
There could be more lines in this function that need the variable (nonzero). A much simpler code is:
function y=dbp(x) y = 10*log10(abs(x(:)))';