Preparing a Challenge 2014 Entry in m-code

The new PhysioNet website is available at: We welcome your feedback.

The file (a zip archive) is a version of a sample entry to the PhysioNet/CinC 2104 challenge written in m-code. If you wish to submit an entry written using MATLAB/Octave m-code, use the sample entry as a model. Note the tree structure in which the files are stored in the sample entry, and reproduce it in your entry.

The sample entry uses GNU Octave, version 3.6.4 (which is preinstalled in the test environment), and the WFDB Toolbox for MATLAB and Octave version (which is installed by the sample entry's script).

Contents of an m-code Challenge entry

The basic requirements for an m-code entry include all of those for any other entry in the Challenge. As detailed in Preparing an Entry for the Challenge on the Challenge 2014 main page, these include:

The sample entry includes an m-code file named challenge.m, which is invoked by to analyze a single test record and to write a beat annotation file for the record. Its contents are:

function challenge(recordName)
% challenge(recordName)
% Sample entry for the 2014 PhysioNet/CinC Challenge.
% This function should takes three parameters:
% recordName
%       String specifying the record name to process
% This function has no output arguments, its writes an "recordName.qrs" annotation file
% at the current directory. Do not include file extensions on the recordName string.
% The annotations file should contain all the beats that you were able
% to detect in the record.
% Dependencies:
%       1) This function requires that you have the WFDB
%       App Toolbox installed. For information on how to install the toolbox
%       please see:
%         Please note that the Toolbox is supported only on MATLAB 2013a
%         and 2013b. Supported operating systems are 64 bit versions of:
%         Linux, Mac OS X, and Windows.
%       2) The CHALLENGE function requires that you have downloaded the challenge
%       data 'set-p' in a subdirectory of the current directory. The subdirectory
%       should be called '/challenge/2014/set-p/' . The 'set-p' dataset can
%       be downloaded from PhysioNet at:
%         This dataset is used by the generateValidationSet.m script to
%         create the annotations on your traing set that will be used to 
%         verify that your entry works properly in the PhysioNet testing 
%         environment. 
% Version 0.9
% Written by Ikaro Silva, December 10, 2013.
% Last Modified: February 11, 2014
% %Example using training data- 
% challenge('100')

%This line is required in order to properly load the WFDB Toolbox
%in the Octave testing framework

%Used for discarding annotations that dont have a minimum number of beats
annName='qrs'; %All competitors are expected to save their annotation as *.qrs

%Get all ECG and blood pressure signals
ecg_ind=get_index(description,'ECG'); %Call subfunction to get channel indices

%%Users can access the raw samples of the record by running the following
%%For more information please see the help in RDSAMP

%Annotated  the first ECG channel with GQRS and default values to generare QRS file

%Run WABP on the record, which by default will analyze the first ABP, ART, or BP signal
   %Read annotations back to compare with ECG annotations to find the one
   %with smallest RR variance (our best estimate)
  [~,best]=min([var(rr_abp) var(rr_ecg)]);
   %If ABP has smallest annotation, overwrite the qrs file from GQRS
     movefile([recordName '.wabp'],[recordName '.' annName]);

%%%%%%%%%%%% Helper Function %%%%%%%%%%%%%%%%%%%%%
function ind=get_index(description,pattern)
for m=1:M

Together with,, and AUTHORS, challenge.m is at the top level of the submission's file tree, not within a subdirectory (folder). You should modify challenge.m to incorporate your own methods for addressing the Challenge problem. If it makes use of other m-files, add them to the entry's top level as well.

For questions or support, please contact

Any updates to this sample entry will be posted here.

Setting up your computer for developing and debugging an m-code entry

Although you may develop an m-code entry using MATLAB, you should install Octave on your computer in order to test your entry for compatibililty with the test environment on PhysioNet. To do this, you will need

Installing Octave's Java package

To install the required Octave Java package on Debian GNU/Linux Wheezy (as on the Challenge test environment), run these commands:

apt-get install liboctave-dev
octave --eval  "setenv(\"JAVA_HOME\",\"/usr/lib/jvm/java-7-openjdk-amd64\");pkg install -forge java;quit;"

These commands have already been run in the virtual machines used to evaluate Challenge entries; do not include them in your

For installation on other platforms, including FreeBSD, Mac OS X, MS-Windows, OpenBSD, and other GNU/Linux distributions, see Download GNU Octave on the Octave web site.

Installing the WFDB Toolbox for MATLAB and Octave

To install the WFDB Toolbox for Octave please follow the Quick Start instructions.

You can replace in the sources directory of your entry with any later version downloaded from the URL above.

Packaging and submitting your m-code entry

To package your entry for submission, arrange all of the files for your entry in a tree structure that matches that of the sample entry. For example, you might have these files:


Use the cd command to set the current directory to the top level of your entry. In the case above, type:

cd /home/alice/entry

Remove any .dat or .hea files in challenge/2014/set-p (these may have been left there by generateValidationSet.m if you used it to make the .qrs annotation files). On most platforms, do this with the command:

rm -f challenge/2014/set-p/*.dat challenge/2014/set-p/*.hea

Then (on Linux, Mac OS X, or MS-Windows with Cygwin or MinGW) use either this command (to make a tarball):

tar cfvz ../entry.tar.gz .

... or this command (to make a zip archive):

zip -r ../ .

On Windows without Cygwin or MinGW, use any zip-compatible tool to make a zip archive, being careful to keep the, etc., files on the top level (i.e., when your entry is unzipped, you should not have entry as your top directory; see the sample file if this is not clear).