Specify whether data and event information are saved to one or to multiple record files
You can configure RecordMode to be overwrite, append, or index. If RecordMode is overwrite, then the record file is overwritten each time recording is initiated. If RecordMode is append, then data is appended to the record file each time recording is initiated. If RecordMode is index, a different record file is created each time recording is initiated, each with an indexed filename.
You can configure RecordMode only when the object is not recording. You terminate recording with the record function. A object that is not recording has a RecordStatus property value of off.
You specify the record filename with the RecordName property. The indexed filename follows a prescribed set of rules. Refer to Specifying a File Name for a description of these rules.
The record file is overwritten.
Data is appended to the record file.
Multiple record files are written, each with an indexed filename.
Suppose you create the serial port object s on a Windows® machine associated with the serial port COM1.
s = serial('COM1'); fopen(s)
Specify the record filename with the RecordName property, configure RecordMode to index, and initiate recording.
s.RecordName = 'myrecord.txt'; s.RecordMode = 'index'; record(s)
The record filename is automatically updated with an indexed filename after recording is turned off.
record(s,'off') s.RecordName ans = myrecord01.txt
Disconnect s from the instrument, and remove s from memory and from the MATLAB® workspace.
fclose(s) delete(s) clear s