Skip to content

removeNSxData

    removeNSxData(timestamps, filename)

    This function removes chunks of data given in a 2-column timestamps
    variable from a NSx file and then saves it as another NSx. This is
    useful when removing useless data from the file to decrease the size of
    the NSx file without modifying the file timestamps. The file size only
    changes when the NSx file is compressed.

    timestamps: This variable contains beginning and ending timestamps of
                the data that need to be removed from the NSx file. The
                format is:
                           [BegTimeStamp1 EndTimeStamp1
                            BegTimeStamp2 EndTimeStamp2
                            BegTimeStamp3 EndTimeStamp3
                                 ...          ...
                            BegTimeStampN EndTimeStampN]

                The data in the NSx between the pairs of timestamps will be
                removed and set to 0.
                (REQUIRED)

    filename:   The name of the NSx file to be used. This input is also
                optional. In its absense, a dialog will open and will
                prompt the user to select an NSx file.
                (OPTIONAL)

    Example:    removeNSxData([100,600; 1000,2000], 'c:\datafile\sampleNSx.ns5')

                In the example above, the timestamps between 100:600 and
                1000:2000 will be removed from the file sampleNSx.ns5 and
                the resulting NSx will be saved in sampleNSx_chunked.ns5
                file.

    Kian Torab
    ktorab@blackrockmicro.com
    Blackrock Microsystems

    Version 1.0.1.0