Regarding code addnoise.m in ideal binary mask
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 @?
0 Kommentare
Antworten (1)
Image Analyst
am 1 Feb. 2015
Bearbeitet: Image Analyst
am 1 Feb. 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.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Author Block Masks finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!