How to plot 2D mesh with a circular area
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I want to plot a 2D mesh as shown in this figure:

Here is where i am so far in the code:
rows=251;
columns=257;
[R, C] = meshgrid(1:10:rows, 1:10:columns);
r=size(R);
c=size(C);
Z=zeros(r(1),c(2));
T = delaunay(R,C);
trimesh(T,R,C,Z)
view(0,300)
x=1:40:columns.*3/4;
theta=(0:5:360)*pi/180;
[th,X]=meshgrid(theta,x);
th2=size(th)
X2=size(X)
A=X.*cos(th);
B=X.*sin(th);
C=zeros(X2(1),th2(2));
T2 = delaunay(A,B);
trimesh(T2,A,B,C);
Which shows a mesh of a rectangle and a circle.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Geometry and Mesh에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!