.\" Copyright (c) 2015-2026, The matio contributors
.\" Copyright (c) 2012-2014, Christopher C. Hulbert
.\" All rights reserved.
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.Dd April 23, 2026
.Dt MAT_VARGETCELL 3
.Os
.Sh NAME
.Nm Mat_VarGetCell
.Nd Gets an element from a cell array.
.Sh SYNOPSIS
.Fd #include <matio.h>
.Ft matvar_t *
.Fo Mat_VarGetCell
.Fa "const matvar_t *matvar"
.Fa "int index"
.Fc
.Sh DESCRIPTION
The
.Fn Mat_VarGetCell
function returns a pointer to the cell element at 0-relative linear index
.Fa index
in the cell array
.Fa matvar .
.Sh RETURN VALUES
On success, a pointer to the requested cell element is returned.
Otherwise NULL is returned.
.Sh EXAMPLES
.Bd -literal
matvar_t *cell;

cell = Mat_VarGetCell(cell_array, 0);
.Ed
.Sh SEE ALSO
.Xr Mat_VarGetCells 3 ,
.Xr Mat_VarGetCellsLinear 3 ,
.Xr Mat_VarSetCell 3
