Documentation

This is machine translation

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

isvalid

Class: handle

Determine valid handles

Syntax

B = isvalid(H)

Description

B = isvalid(H) returns a logical array in which each element is true if the corresponding element in H is a valid handle. A handle variable becomes invalid if the object has been deleted.

You cannot override the isvalid method in handle subclasses.

Input Arguments

expand all

Input array, specified as an array of object handles.

Output Arguments

expand all

Result of validity test, returned as a logical array the same size as H in which each element is true if the corresponding element in H is a valid handle.

Attributes

Accesspublic
Sealedtrue

To learn about attributes of methods, see Method Attributes in the MATLAB® Object-Oriented Programming documentation.

Examples

Test for Valid Handles

This example tests a handle array for valid members:

H = plot(rand(5));
delete(H(3:4))
B = isvalid(H)
B =

     1
     1
     0
     0
     1
Was this topic helpful?