Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Our colleagues on West campus (i.e. in medicine) have collectedheart rate data for a set of patients. They measure heart rates of a set of

Our colleagues on West campus (i.e. in medicine) have collectedheart rate data for a set of patients. They measure heart rates of a set of patients while at rest, then weeks later measure the same set of patients again at rest. The trial period may have involve dexercise, dieting, or medication. They have asked us to perform somebasic analysis on the data. The data comes to us in 2 separate text files. Each text file contains N > 0 heart rates, one per line. The first line of each file represents patient #1, the second line of each file represents patient #2, and so on. Here are the files trial1-start.txtand trial1-end.txt:Patient # 1 2 3 4 5, trial1-start.txt 78 82 78 91 93 trial1-end.txt1 78 81 73 93 73. Note that in this dataset, the heart rates of patients 2 and 3 have gone down, the heart rate of patient 4 has gone up, and the remaining patients (1 and 5) saw no change in their heart rates. Since the # of patients whose heart rate dropped (2) is greater than the # of patients whose heart rate wentup (1),we say that the heart rates are trendingdownward: '-'. The percentage of patients whose heart rate when down is 40.0 (i.e. 2/5). The maxchange downward was -5, and the patient with the max change downward was #3. Your assignment is to write a function AnalyzeHRs(file1, file2)that loads the heart rate data from 2 files, and computes the trend, percentage of patients who saw this trend, the max change in this trend, and the patient who experienced the max change:function [Trend, Percentage, MaxChange, Patient] = AnalyzeHRs(file1, file2)..end Page 2of 3For example, given the input files shownearlier, the call[Trend, Percentage, MaxChange, Patient] = AnalyzeHRs('trial1-start.txt', 'trial1-end.txt')would return the following results:

Trend: '-

'Percentage: 40.0

MaxChange: -5

Patient: 3

Note: The data points for analysis of heart rate are are given in a seprate file by my instructor. I just need to write a function to call the both files. However, they are as follow:

trial1.start.txt - 78, 82, 78, 91, 73

trial1.end.txt - 78, 81, 73, 93, 73

trial2.start.txt - 80, 78, 82, 78, 91, 73, 56, 71, 78

trial2.end.txt - 80, 78, 81, 83, 93, 73, 56, 71, 68

#patients - 1, 2, 3, 4, 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle PL/SQL Programming Database Management Systems

Authors: Steven Feuerstein

1st Edition

978-1565921429

More Books

Students also viewed these Databases questions

Question

=+ How well do you think you could do your job?

Answered: 1 week ago