How to build a rotationally symmetric mask?

2 次查看(过去 30 天)
Hi everyone, suppose I have 'p' given by a generalized Gaussian function and want to make a rotationally symmetric mask of it (i.e. a 2d square). Any easy way?
%_____________________________________________
x = -6:0.01:6;
alfa=2; beta=10; mean=0;
p=(beta/(2*alfa*gamma(1/beta))).*exp(-((abs(x-mean)/alfa).^beta));
plot(x,p)

采纳的回答

Matt J
Matt J 2013-1-8
p= @(x) (beta/(2*alfa*gamma(1/beta))).*exp(-((abs(x-mean)/alfa).^beta));
[xx,yy]=ndgrid(-6:0.01:6);
mask = p(sqrt(xx.^2+yy.^2))

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Digital Filter Analysis 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by