Search code examples
matlabhandle

Check if matlab handle is a figure handle


How to check if a matlab handle is a handle of a figure or not ?


Solution

  • To test for a figure handle without risking an error, you do the following:

    isFigureHandle = ishandle(h) && strcmp(get(h,'type'),'figure')