Use the "generateMesh" function in the Partial Differential Equation Toolbox to generate a 3D mesh.
Refer to the following example that imports a 3D model, creates a mesh, and displays the mesh.
model = createpde;
importGeometry(model,'Torus.stl');
mesh = generateMesh(model);
[p,e,t] = meshToPet(mesh);
figure; pdemesh(mesh);
figure; pdemesh(p,e,t);
For more details refer to the following link:
Best Answer
You can get this information easily in the latest version of MATLAB, which is R2018a. The function you need to use is findNodes.
Here is a simple example with block as geometry: