Vector to Circle in Matrix

1 次查看(过去 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?

采纳的回答

Akira Agata
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 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by