How to import a .msh file (2D) in Matlab ?

11 ビュー (過去 30 日間)
hakim oueslati
hakim oueslati 2023 年 1 月 18 日
編集済み: hakim oueslati 2023 年 1 月 18 日
I used GMSH to build a mesh with a simple 2D geometry. So I got an .msh file that I want to read on Matlab to get the (p,e,t) matrices from the pdetoolbox. I have attached the .zip folder containing the .msh file.
I found a script on gmsh2pdetoolbox which is used to read .msh files on Matlab to obtain the 3 matrices (p,e,t) . When trying to run it, the following error is displayed:
Syntax error (no $Nodes/$NOD) in: mesh_PB.msh
Syntax error (no $Elements/$ELM) in: mesh_PB.msh
Dot indexing is not supported for variables of this type.
Error in gmsh2pdetoolbox_rev>load_gmsh4 (line 275)
for i = 1:msh.nbElm
Error in gmsh2pdetoolbox_rev (line 18)
mesh_structure = load_gmsh4(filename,-1);
Error in Script_A_MH_L (line 34)
[p,e,t] = gmsh2pdetoolbox_rev('mesh_PB.msh');
The command used for the execution is :
[p,e,t] = gmsh2pdetoolbox_rev('mesh_PB.msh');
As I understand it, the msh structure does not contain an element called nbElm. Either there is an error in the script I found or there is a detail I am missing.

回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometry and Mesh についてさらに検索

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by