Products & Services Solutions Academia Support User Community Company

Learn more about Instrument Control Toolbox   

isvalid - Determine whether instrument objects are valid

Syntax

out = isvalid(obj)

Arguments

obj

An instrument object or array of instrument objects.

out

A logical array.

Description

out = isvalid(obj) returns the logical array out, which contains a 0 where the elements of obj are invalid instrument objects and a 1 where the elements of obj are valid instrument objects.

Remarks

obj becomes invalid after it is removed from memory with the delete function. Because you cannot connect an invalid object to the instrument, you should remove it from the workspace with the clear command.

Examples

Suppose you create the following two GPIB objects:

g1 = gpib('ni',0,1);
g2 = gpib('ni',0,2);

g2 becomes invalid after it is deleted.

delete(g2)

isvalid verifies that g1 is valid and g2 is invalid.

garray = [g1 g2];
isvalid(garray)
ans =
     1     0

See Also

Functions

clear, delete

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS