# meshS export to Matlab

**URL:** <https://community.freefem.org/t/meshs-export-to-matlab/4385>\
**Category:** General Discussion\
**Created:** [October 13, 2026, 8:25am UTC](https://community.freefem.org/t/meshs-export-to-matlab/4385 "2026-10-13T08:25:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wrg11](https://avatars.discourse-cdn.com/v4/letter/w/ebca7d/32.png) [@wrg11](https://community.freefem.org/u/wrg11)\
**Post date:** [October 13, 2026, 8:25am UTC](https://community.freefem.org/t/meshs-export-to-matlab/4385/1 "2026-10-13T08:25:19Z")

</div>

I’ve created a meshS object describing the (3D) deformed shape of a 2D plane. I’d like to plot it in Matlab. I export it using savemesh: `savemesh(ThNew,"defmshrl.mesh");` and then try the Matlab import with the ffmatlib utility ffreadmesh: `[p,b,t,nv,nbe,nt,labels] = ffreadmesh('defmshrl.mesh')`. The result is an error message:

```auto
Note: Edges not implemented
Index in position 1 exceeds array bounds. Index must not exceed 1.

Error in ffreadmesh (line 212)
              regions=unique(t(5,:));

```

At a guess, this is because ffreadmesh is looking for tetrahedra, and a meshS object has triangles. Assuming this is correct, my questions are:

1. Is there any way to transfer meshS using the ffmatlib utilities?

2. If not, how should I go about it?
