This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mxSetClassName (C)

Structure array to MATLAB object array

Use mxSetClassName for classes defined without a classdef statement.

C Syntax

#include "matrix.h"
int mxSetClassName(mxArray *array_ptr, const char *classname);



Pointer to an mxArray of class mxSTRUCT_CLASS


Object class to which to convert array_ptr


0 if successful, and nonzero otherwise. One cause of failure is that array_ptr is not a structure mxArray. Call mxIsStruct to determine whether array_ptr is a structure.


mxSetClassName converts a structure array to an object array, to be saved later to a MAT-file. MATLAB® does not register or validate the object until it is loaded by the LOAD command. If the specified classname is an undefined class within MATLAB, LOAD converts the object back to a simple structure array.

Introduced before R2006a

Was this topic helpful?