Square function for binary grating

1 回表示 (過去 30 日間)
Xiaolei
Xiaolei 2016 年 8 月 22 日
編集済み: Walter Roberson 2016 年 8 月 22 日
Hi everyone,
I try use square function to generate binary grating. But I found when I increase frequency, the period of pattern changed? Does anyone know this problem? Any suggestion would be very helpful.
Thank you so much.
Xiaolei
Code:
wDeg=1;%size of image(in degrees)
nxPix=80;
nyPix=40;
[x,y]=meshgrid(linspace(0,wDeg,nxPix+1),linspace(0,wDeg,nyPix+1));
x=x(1:end-1,1:end-1);
y=y(1:end-1,1:end-1);
sf=20;
grating =1+square(2*pi*sf*x);

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by