How to build a rotationally symmetric mask?

1 回表示 (過去 30 日間)
Mario Trevino
Mario Trevino 2013 年 1 月 8 日
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))
  1 件のコメント
Mario Trevino
Mario Trevino 2013 年 1 月 8 日
thanks a lot Matt!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by