MATLAB File Help: wrsamp View code for wrsamp WFDB Contents

function varargout=wrsamp(varargin)


    Wrapper to WFDB WRSAMP:

 Writes data into a WFDB compatible *.dat and *.hea files. The files will be saved at
 the current directory (if the record is in the current directory) or, if a using 
 a PhysioNet web record , a subdirectory in the current directory, with 
 the relative path determined by recordName. You can use RDSAMP to
 verify that the write was completed successfully (see example below). For
 detailed information on the parameters described below, please see:

        The input variables 'tm' and 'data' should be integer values.
		 Currently the MATLAB/Octave wrappers do take into account Baseline values. 
        Signals that have baseline values will not be converted properly to physical units.
        You will have to edit the generated header files manually to include baseline variables and update the checksums.

 Required Parameters:

       Nx1 vector of integers representing sample index.

       NxM vector of integers (M channels) that will be written to file.


       String specifying the file name. WRSAMP will write the signal file in 
       the current directory as "fileName.dat", and create a header file in the 
       current directory "fileName.hea" for the specified record.  

 Optional Parameters:

       A 1x1 double specifying the sampling frequency (in samples per second per 
       signal) for the output signals (default: 250). It affects the output header 
       file only. This option has no effect on the output signal file, which 
       contains one sample per signal for each line of input. 

       A 1x1 or Mx1 vector of doubles specifying gain value in A/D units per millivolt 
       for the output signals (default: 200).  This option the output header file only. 
       This option has no effect on the output signal file. 

       String specifying the signal's default format (default: "16"). For
       information on the available WFDB formats please see:

%Read signal in raw units
%Write a copy to file
%Check that the signals match
err=sum(signalCopy ~= signal(:,1))

 Written by Ikaro Silva, 2013
 Last Modified: April 10, 2015
 Since 0.0.1

 See also rdsamp, wfdbdesc, mat2wfdb