Solved MATH 344 Lab – Assignment 2

$25.00

Original Work ?

Download Details:

  • Name: Assignment2-haqhkt.zip
  • Type: zip
  • Size: 163.78 KB

Category: Tags: , You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

Rate this product

(1) Write a function called calculate Grades that takes an arbitrary length
vector of grades, then curves them.
(a) Compute the mean of grades (use for loop, not the built-in function
mean())
(b) Normalize grades so that the mean is 70 by doing the following: curvedGrade = 70*grades/mean.
(c) Test your function with a vector score = [50, 80, 54, 85, 73, 67]. Include
the output in diary.
(d) Test your function with a vector score = rand(1,100) * 100.
(2) Write a function called mymat that creates an n × n matrix with 11, 22,
33, . . . , 11n on the subdiagonal of a sqaure matrix (elements directly under
the diagonal) and zeros everywhere else. For example, for n = 4 the matrix
would be
A =


0 0 0 0
11 0 0 0
0 22 0 0
0 0 33 0


The function should input the matrix size, n, and output a matrix, A, as
described above. Test your program with n = 2, n = 6 and n = 10. These
tests should be in the diary you turn in.
HW GUIDELINES
• You should turn in both your completed code (two m-files), and a diary
containing successful execution of each code (using the tests given in the
problems). Your grade will be based on correctness, completeness, organization, and neatness.
• Your m-files should return a value as a variable (do not print the answer
on the screen). Turn in a diary file showing the code executed correctly.
• Remember that m-files should be commented so that the reader knows what
the program/function does. Include your name and section number on the
top of the first page.