Vector to Circle in Matrix
2 ビュー (過去 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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/208491/image.png)
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 で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!