Borrar filtros
Borrar filtros

Regarding code addnoise.m in ideal binary mask

1 visualización (últimos 30 días)
Hemangi
Hemangi el 1 de Feb. de 2015
Editada: Image Analyst el 1 de Feb. de 2015
while running addnoise.m code available in ideal binary mask folder on mathworks site I've come across a command SNR = @(signal,noisy)( 20*log10(norm(signal)/norm(signal-noisy)) ); what is meaning of @(signal,noisy)? The terms in second bracket are signal to noise ratio in db.Then what is the need of @?

Respuestas (1)

Image Analyst
Image Analyst el 1 de Feb. de 2015
Editada: Image Analyst el 1 de Feb. de 2015
It indicates that it is an anonymous function. Sort of like a short one-liner macro type of function rather than a full blown function like you're probably used to. Maybe they call it anonymous because no one understands them or knows what they are or how to use them, as is evident in your case, and with many other novices. :-)
If you like, you can use a traditional function instead of that cryptic one-liner form.
function output = SNR(signal,noisy)
output = 20*log10(norm(signal)/norm(signal-noisy));
The @ in the line indicates that it's now going to list the input arguments. They are listed separated by commas and wrapped in parentheses.

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by