---
name: "Mat_GetVersion"
section: "3"
platform: "linux"
package: "libmatio"
version: "1.5.30-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Mat_GetVersion"
---

# Mat\_GetVersion(3)

Returns the version of a MATLAB MAT file given a MAT file structure.

## NAME

**Mat\_GetVersion** – Returns the version of a MATLAB MAT file given a MAT file structure.

## SYNOPSIS

**#include \<matio.h\>**

*enum* *mat\_ft*\

**Mat\_GetVersion**(*const mat\_t \*matfp*);

## DESCRIPTION

The **Mat\_GetVersion**() function returns the version of the MATLAB MAT file given by the MAT file structure.

## RETURN VALUES

The return value is one of the following:

- **MAT\_FT\_MAT4** if the file is a version 4 MAT file.

- **MAT\_FT\_MAT5** if the file is a version 5 MAT file.

- **MAT\_FT\_MAT73** if the file is an HDF5 MAT file.

## SEE ALSO

[Mat\_CreateVer(3)](/Mat_CreateVer/3.md), [Mat\_Open(3)](/Mat_Open/3.md), [Mat\_GetFileAccessMode(3)](/Mat_GetFileAccessMode/3.md), [Mat\_GetFilename(3)](/Mat_GetFilename/3.md), [Mat\_GetHeader(3)](/Mat_GetHeader/3.md)
