I want to make a matrix that has a weight of 1 inside a circle and 0 outside the circle. Along the edges in portions that are not fully inside the circle, I want it to have a partial weight based on how inside the circle it is. I have been able to successfully make a crude circle that only has 1 if it is fully in the circle and 0 otherwise, but I am not sure how to do the rest of the circle.
This is how I did it:
ref1 = (double((I-r).^2+(J-r).^2<=r^2));
Any hints would be extremely appreciated!