How to plot 2D mesh with a circular area
Show older comments
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 Comment
VBBV
on 30 Dec 2020
Use pdetool for mesh generation in matlab
Answers (0)
Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!