forked from hsd1503/ENCASE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.sh
43 lines (37 loc) · 1.22 KB
/
next.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#! /bin/bash
#
# file: next.sh
#
# This bash script analyzes the record named in its command-line
# argument ($1), and writes the answer to the file 'answers.txt'.
# This script is run once for each record in the Challenge test set.
#
# The program should print the record name, followed by a comma,
# followed by one of the following characters:
# N for normal rhythm
# A for atrial fibrillation
# O for other abnormal rhythms
# ~ for records too noisy to classify
#
# For example, if invoked as
# next.sh A00001
# it analyzes record A00001 and (assuming the recording is
# considered to be normal) writes "A00001,N" to answers.txt.
set -e
set -o pipefail
RECORD=$1
rm -rf data1
mkdir data1
matlab -nodisplay -nosplash -r \
"preprocess_sub('$RECORD'); quit"
python3 code/challenge.py
# Example (Matlab)
# matlab -nodisplay -nodisplay -nosplash -r \
# "try x = challenge('$RECORD'); \
# f = fopen('answers.txt', 'a'); fprintf(f, '$RECORD,%s\n', x); fclose(f); \
# catch e; display(getReport(e)); exit(1); end; quit"
# Example (Octave)
#octave -q -f --eval \
# "pkg load signal; pkg load statistics;
# x = challenge('$RECORD');
# f = fopen('answers.txt', 'a'); fprintf(f, '$RECORD,%s\n', x); fclose(f);"