Set a specific spatial frequency for my Guassian generated dots
古いコメントを表示
Hello! I am fairly new to Matab and I am stuggling with including a specific spatial frequency for my dot pattern.I need to generate polka dot patterns using either sine waves or gassian function with a specific satial frequency. I decided to use Gaussian funtion. In the code below, I am generating random dots using the Gaussian function. I need my dots to have a specific spatial frequency so that I can divide my pictures into low spatial frequncy and high spatial frequncy groups. But I am struggling to figure out how to do that. Any help/tips is much appreciated.
N=560;
nDots = 5;
s=25;
[x,y]=meshgrid(1:N,1:N);
xc=rand(nDots,1)*N
yc=rand(nDots,1)*N
val=zeros(N)
for k=1:nDots
r2=(x-xc(k)).^2 + (y-yc(k)).^2;
val = val + exp(-r2 / (2*s^2));
end
imagesc(val);
colormap gray;
axis equal;
axis off;
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Data Distribution Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
