Main Content

class

Class of object

Description

className = class(obj) returns the name of the class of obj.

example

Examples

collapse all

Get the class name of a Java® object.

jObject = java.lang.String('Java string');
className = class(jObject);
disp(className)
java.lang.String

Determine the class of a variable.

h = @sin;
className = class(h);
disp(className)
function_handle

Input Arguments

collapse all

Object or literal, specified as a variable or an expression.

Example: class(date)

Output Arguments

collapse all

Name of the class, returned as a character vector.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a