0% found this document useful (0 votes)
62 views

Lab Assignment

The document outlines a lab assignment with the following tasks: 1. Write a Matlab function to convert between metric and English units. 2. Create two plots in the same figure showing sinc(x) and sin(x) between input min and max angles in radians. 3. Write a function to calculate a student's average grade excluding the lowest test score, determine the letter grade, and output the grade. It also lists two homework problems: 1. Generate a random 201x201 matrix and replace values outside a range with 0. 2. Expand on task 3 to calculate letter grades for multiple students from a data file, outputting the number of each letter grade.

Uploaded by

cakhoa
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Lab Assignment

The document outlines a lab assignment with the following tasks: 1. Write a Matlab function to convert between metric and English units. 2. Create two plots in the same figure showing sinc(x) and sin(x) between input min and max angles in radians. 3. Write a function to calculate a student's average grade excluding the lowest test score, determine the letter grade, and output the grade. It also lists two homework problems: 1. Generate a random 201x201 matrix and replace values outside a range with 0. 2. Expand on task 3 to calculate letter grades for multiple students from a data file, outputting the number of each letter grade.

Uploaded by

cakhoa
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

23/4/09 Lab Assignment #5

LAB ASSIGNMENT:
1. 2. Write a Matlab function that converts Metric Unit to English Unit. a. 2.54 cm = 1 inch Write a Matlab function file that takes two values of x (min x, and max x) and displays two plots on the same figure from min x to max x. x is angle in radian. a. subplot 1, Sinc(x) b. subplot 2, sin(x) Write a Matlab FUNCTION file that does the following:

3.

(1) The user inputs a vector of test grades (2) The program excludes the minimum test grade and computes an average score based on the remaining exam grades. (3) Based on the average grade calculated above the program: a. Displays the letter grade of the student to the screen (e.g. The student grade is a B or The student grade is a D) b. Outputs the letter grade to the user. Assume the grades are calculated as: A = 90-100 B = 80-90 C= 70-80 D=60-70 F <60 If a student achieves the exact average score of 60, 70, 80 or 90 give them the higher grade.

Homework Problems #5 1. Write a Matlab Script file that generates a random (201x201) matrix A. For every entry in the matrix A that is less than 0.25 or greater than 0.75 replace that entry with a 0. 2. Write a Matlab Function file that extends on the laboratory assignment #5 to include a whole class of grades. A test grade file will be provided by your instructor. You can load the data into Matlab using the load command. (i.e. >> load class_grades.mat ). The variable GRADES contains the matrix of test grades. (1)The user inputs a matrix of test grades. Each column of the matrix is a list of test grades for a different student. Thus the size of the input matrix is (Number of exams x Number of Students) (2) The program excludes the minimum test grade for each student and computes an average score for each student based on the remaining exam grades. (3) Based on the average grades calculated above the program: c. Displays a vector of letter grades (one grade for each student) to the screen d. Outputs a vector of letter grades to the user (one grade for each student). (4) The program the number of As, Bs, Cs, Ds and Fs for the class and displays those numbers to the screen. (example: The number of As is 5 The number of Bs is 10 The number of Cs is 8 The number of Ds is 3 The number of Fs is 1 ) Assume the grades are calculated as: A = 90-100 B = 80-90 C= 70-80 D=60-70 F <60 If a student achieves the exact average score of 60, 70, 80 or 90 give them the higher grade.

2- From the example in class (time to impact), the initial angle is assumed to be 90 degree (straight up in the air). Modify the example 2 to include the followings: the initial angle to calculate the distance the object has travelled.

You might also like