Question
A lab instrument generates 25 data points (as negative or positive inetgers) every minute. This data is captured in a file that represents every minutes
A lab instrument generates 25 data points (as negative or positive inetgers) every minute. This data is captured in a file that represents every minutes reading as a 5 x 5 table, e.g. here is the data for 2 minutes:
14 32 39 41 56
59 1 19 19 53
23 37 47 49 29
66 1 24 25 56
62 73 13 22 51
12 65 50 30 23
26 53 38 11 1
35 19 15 66 14
26 22 60 33 36
48 33 3 -3 41
Each data file contains data for 100 minutes of time.
in order to analyze the data it must first be nromalized.. Data is normalized to all positive values by adding the absolute value of the smallest value in the data set (call this abs(s)) to all the values in the set; this will have the effect of shifting all data by the value abs(s).
the data file can be found at the URL below:
http://liberty.egr.vcu.edu/~resler/lab10spring16.dat
input your data from the standaed input via redirection in the command line.
You are to complete the following program by writing all of the needed functions; you can use the definition for SIZE and TIME as needed in your functions.
#include
#define SIZE 5 #define TIME 100
int inputData(int [][SIZE][TIME]); // inputs the data, returns the number of items read in
void printDataAtTime(int [][SIZE][TIME]); // Outputs the SIZE x SIZE table at time t
void printSampleData(int [][SIZE][TIME]); // Prints the SIZE x SIZE able at time 0 and time TIME-1
int normalize(int [][SIZE][TIME}); // Normalizes the data and returns the shift amount
int main (void) {
int data[SIZE][SIZE][TIME]; printf("count = %d ", inputData(data)); printf(" Sample of data: "); printfSampleData(data); printf(" shift = %d ", normalize(data)); printf(" Sample of data after shift: "); printSampleData(data); return(0); }
liberty: /cprogs/96 a.out lab1 Fall15. dat count 2500 Sample of data 14 32 39 41 56 59 1 19 19 53 23 37 47 49 29 66 1 24 26 54 62 73 13 22 51 62 0 29 50 32 28 25 45 46 61 32 11 3 5-5 66 38 35 38 35 39 35 3 46 56 shift Sample of data after shift: 23 41 48 50 65 68 10 28 28 62 32 46 56 58 38 75 10 33 35 63 71 82 22 31 60 71 9 38 59 41 37 34 54 55 70 41 20 12 14 4 75 47 44 47 44 48 44 12 55 65 liberty: /cprogs/96
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started