---
name: "Mat_GetDir"
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_GetDir"
---

# Mat\_GetDir(3)

Returns a list of the variable names of a MATLAB MAT file given a MAT file structure

## NAME

**Mat\_GetDir** – Returns a list of the variable names of a MATLAB MAT file given a MAT file structure

## SYNOPSIS

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

*char* *\** *const* *\**\

**Mat\_GetDir**(*mat\_t \*matfp*, *size\_t \*n*);

## DESCRIPTION

The **Mat\_GetDir**() function returns a list of the variable names of a MATLAB MAT file given the MAT file structure. The output argument *n* holds the number of variables of the MATLAB MAT file.

## RETURN VALUES

The function returns a read-only list of the variable names of a MATLAB MAT file.
