You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
213 B
Matlab

function I=define_circle(len,wid);
maxdiam=odd(len,1);
[x y]=meshgrid(-fix(maxdiam/2)-1:fix(maxdiam/2)+1,fix(-maxdiam/2)-1:fix(maxdiam/2)+1);
radius=sqrt(x.^2+y.^2);
I=exp((-(radius-(len/2)).^2)./(0.5*wid.^2));