Import mesh from Ansys

Imports the mesh from a .dat file generated by Ansys into Matlab


Updated Thu, 08 Oct 2020 20:32:11 +0000

View License

If you have a finite element mesh generated in Ansys Workbench and want to import it into Matlab, do the following:

- in Ansys workbench: Create an "input file" (in the model, select "solution" in the tree, click "tools"->Write input file)

- in Matlab: pass the file name of the input file to the function 'importMesh_ansys2D'.

The function reads the vertex coordinates and connectivity from the .dat file and stores them into Matlab arrays. For an example, see the file 'test_importMesh'.

- Works for 2D only. However, the extension to 3D should be straightforward by selecting the corresponding columns in the connectivity.
- The additional nodes (in case of quadratic shape functions) are ignored.
- For triangular elements, the connectivity table repeats the third vertex. This format is adopted from Ansys.

Cite As

Hauke Gravenkamp (2023). Import mesh from Ansys (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2020a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

add example file