Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Develop a solution to the following using Matlab. Generate your solution using a

ID: 1831783 • Letter: D

Question

Develop a solution to the following using Matlab. Generate your solution using a script. Show your results.
Compute
a. A signal x = 256 samples of random noise and plot it.
b. Use a for loop and determine the min and the max points.
c. Use a for loop to find the average and the median value of the signal x. (use the Matlab functions only to verify these)
d. Use a for loop and if statements to count the number of samples that lie between the average and the median


Explanation / Answer

x=rand(1,256); n=1:256; stem(n,x); mini=1; for i=1:256 if x(i)maxi maxi=x(i); end end maxi sum=0; for i=1:256 sum=x(i)+sum; end avg=sum/256 median1=median(x) k=0; for i=1:256 if avg>median1 if (x(i)>median1&&x(i)avg if (x(i)avg) k=k+1 end end end k .................................................................................................. output: mini = 3.9890e-005 maxi = 0.9992 avg = 0.4916 median1 = 0.4863 k = 2