Documentation Center

  • Trial Software
  • Product Updates

namem

Names of graphics objects

Syntax

  • obj_names = namem example
  • obj_names = namem(h)

Description

example

obj_names = namem returns the names of all the objects on the current axes. The name of an object is the value of its Tag property, if specified. Otherwise, the name of the object is the value of its Type property. The values of these properties are either set at object creation or defined using the tagm function.

obj_names = namem(h) returns the name of the object (or objects) specified by the array of Handle Graphics object handles, h.

Examples

expand all

Get List of Handles to Handle Graphics Objects in Map Display

Display a map in a figure window.

load korea
h = worldmap(map, refvec);
set(h, 'Visible', 'off')
geoshow(h, map, refvec, 'DisplayType', 'texturemap')
demcmap(map)

Get a list of all the names of Handle Graphics® objects in the display.

obj_names = namem
obj_names =

surface 
PLabel  
MLabel  
Meridian
Parallel
Frame   

Convert the array of names into a cell array.

obj_names_cell = cellstr(obj_names)
obj_names_cell = 

    'surface'
    'PLabel'
    'MLabel'
    'Meridian'
    'Parallel'
    'Frame'

Input Arguments

expand all

h — Handle Graphics objectsarray of handles

Handle Graphics objects, specified as an array of handles.

Example:

Data Types: double

Output Arguments

expand all

obj_names — Names of Handle Graphics objectscharacter matrix

Names of Handle Graphics objects, returned as a character matrix. namem removes duplicate object names from the output string matrix.

Note: Use cellstr(obj_names) to convert obj_names to a cell array of strings.

See Also

| | | | |

Was this topic helpful?