Vector to Circle in Matrix
조회 수: 4 (최근 30일)
이전 댓글 표시
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
채택된 답변
Akira Agata
2019년 3월 15일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!