Remove instrument objects from memory
An instrument object or an array of instrument objects.
obj from memory.
This example creates the GPIB object
g to the instrument, writes and reads text data, disconnects
g from memory using
delete, and then removes
g from the
g = gpib('ni',0,1); fopen(g) fprintf(g,'*IDN?') idn = fscanf(g); fclose(g) delete(g) clear g
When you delete
obj, it becomes an invalid
object. Because you cannot connect an invalid object to the instrument, you should
remove it from the workspace with the
clear command. If multiple
obj exist in the workspace, then deleting one
reference invalidates the remaining references.
obj is connected to the instrument, it has a
Status property value of
open. If you
obj is connected, the
connection is automatically broken. You can also disconnect
from the instrument with the
obj is an interface object that is associated with a device
object, the device object is automatically deleted when
deleted. However, if
obj is a device object, the interface object
is not automatically deleted when
obj is deleted.
Introduced before R2006a