How to plot 2D mesh with a circular area

조회 수: 1 (최근 30일)
Matthew Worker
Matthew Worker 2020년 12월 30일
댓글: VBBV 2020년 12월 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.
  댓글 수: 1
VBBV
VBBV 2020년 12월 30일
Use pdetool for mesh generation in matlab

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Geometry and Mesh에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by