Question: Using Matlab! Given a set of m sorted random variables: I = {21, ..., Im}, its median Med(2) is the middle number. Med (2) I(m+1)/2,
Using Matlab!

Given a set of m sorted random variables: I = {21, ..., Im}, its median Med(2) is the middle number. Med (2) I(m+1)/2, Im/2+1(m/2)+1 if m is odd if m is even (1) The median of a finite list of numbers can be computed by built-in MATLAB function median. For example: A = [1 3 2 5 7 2 10 pi]; median (A) 1 2 ans 3 a) Write a function named myMedian that replicate this behaviour. It should take an input vector x, and then compute and output its median according to Eq. (1). b) Program validation. Verify your function on two examples of your choice (e.g., using randn(1,m) to generate m random numbers). Compare your result to the result of the corresponding built-in MATLAB function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
