How do I fill in the required areas?

2 ビュー (過去 30 日間)
Igor Arkhandeev
Igor Arkhandeev 2021 年 1 月 13 日
回答済み: Igor Arkhandeev 2021 年 1 月 14 日
Hello everyone! I try to fill areas as show on picture (as example below). The code to construct this diagramm is next:
n = 10;
m = 20;
for i = 1:n
rectangle('Position',[-i*0.5 -i*0.5 i i],'Curvature',[1 1]);
end
axis equal;
step = 2*pi/(m);
for j = 1:m/2
h(j) = sin((j-1)*step)*n/2;
w(j) = cos((j-1)*step)*n/2;
line([-w(j) w(j)], [-h(j) h(j)],'Color','red');
end
Numbers n and m will be changed. How do I fill in the required areas? In future this graph will be in 3D format, where white color is higher (z = 1), black color z = 0.

採用された回答

Igor Arkhandeev
Igor Arkhandeev 2021 年 1 月 14 日
Currently, I have managed to get this type of diagram, but it requires quite a lot of computer power and was built directly through a set of filled polygonal regions. If anyone has any suggestions, please email me ggw1996fti@gmail.com

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by