Disconnect serial port object from device
fclose(obj)
disconnects fclose(obj)
obj
from
the device, 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, connects s
to the device,
writes and reads text data, and then disconnects s
from
the device using fclose
.
s = serial('COM1'); fopen(s) fprintf(s, '*IDN?') idn = fscanf(s); fclose(s)
At this point, the device is available to be connected to a
serial port object. If you no longer need s
, you
should remove from memory with the delete
function,
and remove it from the workspace with the clear
command.