Skip to content

matrixToNSx

  matrixToNSx

  Converts a MATLAB data matrix (channels as rows, samples as columns) into
  a NSx file.

  Use matrixToNSx(inputData, samplingFreq, inputUnits, savedDataPath)

  All input arguments are optional.

    inputData:     data matrix (channels as rows, samples as columns) into
                   a NSx file.

    samplingFreq:  Sampling frequency of the data. Currently only 500Hz,
                   1kHz, 2kHz, 10kHz, and 30kHz sampaling frequencies are
                   supported.

    inputUnits:    The unit for the recorded data. Most data acquisition 
                   systems save the data in units of ยตV. TDT units are V.
                   The supported units are V, mV, uV or nV.

    savedDataPath: The full path (excluding the extension) of the saved
                   file.

    Example 1 (Mac): 
    matrixToNSx(myData, 30000, 'uv', '/Desktop/newConvertedFile');

    In the example above, the data matrix myData recorded at 30kHz will be
    saved on the Desktop (Mac style path) as newConvertedFile.ns5 file.

    Example 2 (PC): 
    matrixToNSx(myData, 30000, 'uv', 'C:\Data\newConvertedFile');

    In the example above, the data matrix myData recorded at 30kHz will be
    saved C:\Data folder as newConvertedFile.ns5 file.

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    Kian Torab
    kian@blackrockmicro.com
    Blackrock Microsystems
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  Version History

  1.0.0.0:
    - Initial release.

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%