Programmatically get edge ids from geometry of femodel

I am using matlab’s pde toolbox and setup a geometry for femodel like this:
% Source – https://stackoverflow.com/q/79888928
% Posted by MiB_Coder
% Retrieved 2026-02-16, License – CC BY-SA 4.0

gd = [3 4 0 1 1 0 0 0 1 1]’; % Example: A simple square
sf = ‘S1’;
ns = (‘S1′)’;
[g,bt] = decsg(gd, sf, ns)

fe = femodel(AnalysisType="electrostatic", Geometry=g);
fe.PlanarType = "axisymmetric";

figure(1); clf;

pdegplot(fe, ‘EdgeLabels’, ‘on’, ‘FaceLabels’,’on’);
axis equal off;
I can get a diagram indicating which edge-id is assign to an edge:

The resulting geometry does not contain information, which vertices form the edges:
>> fe.Geometry

ans =

fegeometry with properties:

NumFaces: 1
NumEdges: 4
NumVertices: 4
NumCells: 0
Vertices: [4×2 double]
Mesh: []
How can I retrieve which edge id belongs to which vertices in the geometry.
How can I retrieve which edge id is where programmatically?How can I retrieve which edge id is where programmatically?I am using matlab’s pde toolbox and setup a geometry for femodel like this:
% Source – https://stackoverflow.com/q/79888928
% Posted by MiB_Coder
% Retrieved 2026-02-16, License – CC BY-SA 4.0

gd = [3 4 0 1 1 0 0 0 1 1]’; % Example: A simple square
sf = ‘S1’;
ns = (‘S1′)’;
[g,bt] = decsg(gd, sf, ns)

fe = femodel(AnalysisType="electrostatic", Geometry=g);
fe.PlanarType = "axisymmetric";

figure(1); clf;

pdegplot(fe, ‘EdgeLabels’, ‘on’, ‘FaceLabels’,’on’);
axis equal off;
I can get a diagram indicating which edge-id is assign to an edge:

The resulting geometry does not contain information, which vertices form the edges:
>> fe.Geometry

ans =

fegeometry with properties:

NumFaces: 1
NumEdges: 4
NumVertices: 4
NumCells: 0
Vertices: [4×2 double]
Mesh: []
How can I retrieve which edge id belongs to which vertices in the geometry.
How can I retrieve which edge id is where programmatically?How can I retrieve which edge id is where programmatically? I am using matlab’s pde toolbox and setup a geometry for femodel like this:
% Source – https://stackoverflow.com/q/79888928
% Posted by MiB_Coder
% Retrieved 2026-02-16, License – CC BY-SA 4.0

gd = [3 4 0 1 1 0 0 0 1 1]’; % Example: A simple square
sf = ‘S1’;
ns = (‘S1′)’;
[g,bt] = decsg(gd, sf, ns)

fe = femodel(AnalysisType="electrostatic", Geometry=g);
fe.PlanarType = "axisymmetric";

figure(1); clf;

pdegplot(fe, ‘EdgeLabels’, ‘on’, ‘FaceLabels’,’on’);
axis equal off;
I can get a diagram indicating which edge-id is assign to an edge:

The resulting geometry does not contain information, which vertices form the edges:
>> fe.Geometry

ans =

fegeometry with properties:

NumFaces: 1
NumEdges: 4
NumVertices: 4
NumCells: 0
Vertices: [4×2 double]
Mesh: []
How can I retrieve which edge id belongs to which vertices in the geometry.
How can I retrieve which edge id is where programmatically?How can I retrieve which edge id is where programmatically? pde, femodel, edge MATLAB Answers — New Questions

​

Leave a Reply

Your email address will not be published. Required fields are marked *