Remove serial port object from MATLAB workspace
clear obj
clear obj
removes obj
from
the MATLAB® workspace, where obj
is a serial
port object or an array of serial port objects.
This example creates the serial port object s
on
a Windows® platform, copies s
to a new variable scopy
,
and clears s
from the MATLAB workspace. s
is
then restored to the workspace with instrfind
and
is shown to be identical to scopy
.
s = serial('COM1'); scopy = s; clear s s = instrfind; isequal(scopy,s) ans = 1