Link: https://blackboard.cmich.edu/bbcswebdav/pid-3855617-dt-content-rid-3248178
ID: 3759931 • Letter: L
Question
Link: https://blackboard.cmich.edu/bbcswebdav/pid-3855617-dt-content-rid-32481783_1/courses/CPS180-16300-22284994/eeg.csv
You are given a file with your instructor’s EEG signals captured while watching an AR video presentation. The file contains a timestamp, comma, and numbers, one measurement in each row. The first line is a comment line starting with "#". You are to read the file into an line-wise array and determine the averages for each column. This is done in Java Eclipse by the way!
Username & password for link: manzo1rj Snow&board
Explanation / Answer
The username and password isnt working. Unable to login. But let us assume that the file looks something like this
142353663224 , 1 2 3 4
142353663224 , 1 2 3 4
142353663224 , 1 2 3 4
//call this function for very column in a for loop
void calculateAvergaeForEachColumn(int i)
{
BufferedReader br = new BufferedReader(new FileReader("PutNameOfYourCSVFileHere"));
int count=0;
int columnEntries=0;
while ((line = br.readLine()) != null)
{
// using Comma as delimiter and calculating for average for column[i], where is tarts from 1, as column 0 has timestamp
String[] cols = line.split("[,]");
count=count+cols[i];columnEntries=columnEntries+1;
}
float average=(float) count/columnEntries;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.