How to plot 2D mesh with a circular area

1 visualización (últimos 30 días)
Matthew Worker
Matthew Worker el 30 de Dic. de 2020
Comentada: VBBV el 30 de Dic. de 2020
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 comentario
VBBV
VBBV el 30 de Dic. de 2020
Use pdetool for mesh generation in matlab

Iniciar sesión para comentar.

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by