MATLAB Function Reference    
delete (serial)

Remove a serial port object from memory

Syntax

Arguments

obj
A serial port object or an array of serial port objects.

Description

delete(obj) removes obj from memory.

Remarks

When you delete obj, it becomes an invalid object. Since you cannot connect an invalid serial port object to the device, you should remove it from the workspace with the clear command. If multiple references to obj exist in the workspace, then deleting one reference invalidates the remaining references.

If you attempt to delete obj while it is connected to the device, then an error is returned. A connected serial port object has a Status property value of open. You can disconnect obj from the device with the fclose function.

If you use the help command to display help for delete, then you need to supply the pathname shown below.

Example

This example creates the serial port object s, connects s to the device, writes and reads text data, disconnects s from the device, removes s from memory using delete, and then removes s from the workspace using clear.

See Also

Functions

clear, fclose, isvalid

Properties

Status


 delete depdir