Main Content

reset

Reset VITA 49 file reader to first VITA 49 packet of file

Since R2022b

    Description

    reset(vita49ReaderObj) resets the VITA 49 file reader to the first VITA 49 packet of the file. This function resets the number of signal data and context packets traversed to zero.

    example

    Examples

    collapse all

    Create a VITA 49 file reader object, specifying the name of a VITA 49 file.

    vita49ReaderObj = vita49Reader("VITA49SampleData.bin");

    Specify the number of packets to be read.

    numpkt = 4;

    Read the specified number of packets to the MATLAB® workspace.

    [signalDataPacket,contextPacket,contextPacketChangeIndex] = read(vita49ReaderObj,NumPackets = numpkt);

    Display the number of packets read by the object. Because you specified for the function to read 4 packets, the number of packets read is 4.

    numPacketsRead = vita49ReaderObj.PacketsRead
    numPacketsRead = 
    4
    

    Reset the position of the VITA 49 file reader to the first packet of the VITA 49 file.

    reset(vita49ReaderObj);

    Display the number of packets read by the object. Since the reset object function resets the position of the file reader object to the first VITA 49 packet of the file, the value reflects 0 packets read. Read a packet from the object..

    numPacketsRead1 = vita49ReaderObj.PacketsRead
    numPacketsRead1 = 
    0
    
    [signalDataPacket1,contextPacket1,contextPacketChangeIndex1] = read(vita49ReaderObj);

    Display the number of packets read. Because you did not specify a number of packets to read, only the first packet of the VITA 49 file has been read.

    numPacketsRead2 = vita49ReaderObj.PacketsRead
    numPacketsRead2 = 
    1
    

    Clear the vita49Reader System object.

    clear vita49ReaderObj

    Input Arguments

    collapse all

    VITA 49 file reader, specified as a vita49Reader object.

    Version History

    Introduced in R2022b

    See Also

    Objects

    Functions