This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Using the following information x 1 = 1 y 1 = 1 1 = 90 x 2 = 3 y 2 = 1 2 = 90 r 1 = 2 1 =45 yields r 2 = 2 and 2 = 45. Test your code for x 1 = 0 . 5 y 1 =1 1 = 107 x 2 = 5 y 2 = 7 2 = 270 r 1 = 3 1 =40 Write a MATLAB function that 3. Calculates the average and standard deviation of a data set, x . The average and standard deviation are given by average = = 1 N N X k =1 x k standard deviation = v u u t 1 N N X k =1 ( x k ) 2 Your function should input the data set, x , and output both the average and standard deviation. Note that you are not allowed to use any builtin MATLAB functions to complete these calculations. Test your function for x = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10....
View
Full
Document
 Spring '07
 Hayes

Click to edit the document details