MATLAB Answers

0

Vector to Circle in Matrix

Asked by martin martin on 14 Mar 2019
Latest activity Answered by Akira Agata
on 15 Mar 2019
Hello guys, I am trying to fill the matrix (zeros) of values of vector into a circle shape.
A = zeros(50)
This is sketch of my intention, any idea how to fill point in circle?

  0 Comments

Sign in to comment.

1 Answer

Answer by Akira Agata
on 15 Mar 2019
 Accepted Answer

If you have Image Processing Toolbox, one solution would be like this:
A = zeros(50);
A(25,25) = 1;
D = bwdist(A);
idx = D <= 24;
A(idx) = 1;

  0 Comments

Sign in to comment.