Regarding code addnoise.m in ideal binary mask
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Image Analyst
2015-2-1
编辑:Image Analyst
2015-2-1
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Author Block Masks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!