Respuesta aceptada

Walter Roberson
Walter Roberson el 4 de En. de 2014

0 votos

2 comentarios

Amy
Amy el 2 de Feb. de 2014
sorry.where can i find the sol? ><

Iniciar sesión para comentar.

Más respuestas (1)

Roger Stafford
Roger Stafford el 2 de Feb. de 2014

0 votos

It would be better to use the term 'disk' or 'disc' for this. The term 'circle' generally refers to the one-dimensional curve surrounding a two-dimensional disk.
Let ic and jc be the desired indices for the disk's center and r be its radius, and let m and n be the numbers of rows and columns, respectively, in the array.
[I,J] = ndgrid(1:m,1:n);
M = double((I-ic).^2+(J-jc).^2<=r^2); % <-- M should be your desired array

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

Amy
el 4 de En. de 2014

Editada:

Amy
el 3 de Feb. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by