Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The attached text data file, MATRAX.dat, contains the following student exam data: A. Open this file using fopen, skip over the two header lines using
The attached text data file, MATRAX.dat, contains the following student exam data: A. Open this file using fopen, skip over the two header lines using fget 1 , and use a single fscanf command to read the three numerical columns into a 73 matrix of grades, say G. Rewind but do not close the file. B. Then, use a single textscan command to read from the file the two text columns N, I, of student names and netIDs, each being a 7x1 cell array of strings. You may now close the opened file. C. Using the function mean, compute the averages of the three exams for each student. The resulting column vector will be entered under the column labeled AVE in the above table. Enlarge the matrix G by appending to it the column AVE of averages. Then, compute the averages of each column, i.e., the average of each exam for the entire class, including the overall average for all exams and for all students. D. Using the function sortrows, sort the exam grades according the column AVE of averages, in descending order. Then, open a new data file, say, MATRAX2.dat, and using fprintf, write into it the sorted data including the original header lines and the computed averages. You may use a for-loop for printing the table data. The contents of this file should be as follows: Upload the new data file with your recitation report. Repeat this part using at most five fprintf commands (no for-loops)
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