23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2delete (serial)<br />

Purpose Remove a serial port object from memory<br />

Syntax delete(obj)<br />

Arguments<br />

obj A serial port object or an array of serial port objects.<br />

Description delete(obj) removes obj from memory.<br />

delete (serial)<br />

Remarks When you delete obj, it becomes an invalid object. Since you cannot connect an<br />

invalid serial port object to the device, you should remove it from the workspace<br />

with the clear command. If multiple references to obj exist in the workspace,<br />

then deleting one reference invalidates the remaining references.<br />

If you attempt to delete obj while it is connected to the device, then an error is<br />

returned. A connected serial port object has a Status property value of open.<br />

You can disconnect obj from the device with the fclose function.<br />

If you use the help command to display help for delete, then you need to<br />

supply the pathname shown below.<br />

help serial/delete<br />

Example This example creates the serial port object s, connects s to the device, writes<br />

and reads text data, disconnects s from the device, removes s from memory<br />

using delete, and then removes s from the workspace using clear.<br />

s = serial('COM1');<br />

fopen(s)<br />

fprintf(s,'*IDN?')<br />

idn = fscanf(s);<br />

fclose(s)<br />

delete(s)<br />

clear s<br />

See Also <strong>Function</strong>s<br />

clear, fclose, isvalid<br />

Properties<br />

Status<br />

2-429

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!