MATLAB: How to make a grey matrix, that contains a filled circle

cart2polcirclefaqfilledgreymatrix

I have an assignment for my Matlab class in which I have to make a grey matrix (all locations have value 100). In this matrix there should be a filled circle. All the values in the filled circle should be 200. How do I create this? My teacher gave me the following tip: use these functions: rand(), randperm(), indexing, for-loop, gray(), meshgrid(), cart2pol() Some of these functions might not be necessary for creating this circle in the matrix. My assignment is bigger than just creating a filled circle, but i'm not sure which functions are needed, so I decided to show them all.

Best Answer

It's all in the FAQ, in the first and second code snippet: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F