can someone explain to me what is this entire code means?
Mostrar comentarios más antiguos
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)));
Respuesta aceptada
Más respuestas (1)
Ahmed A. Selman
el 24 de Mzo. de 2013
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(:)))';
Categorías
Más información sobre Switches and Breakers en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!