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

Problem 4: Noisy Data Write a script noisify. m where you first create an x vect

ID: 656086 • Letter: P

Question

Problem 4: Noisy Data Write a script noisify. m where you first create an x vector that has integers 1 through lo, and then set a y vector equal to x. Plot this straight line. Now, use a for loop to add noise to the data points; create a new y2 vector that stores the values of y plus or minus 0.25 (Hint: y2 is of the same length as y. Each element of y2 is either larger or smaller than the corresponding element of y by 0.25. Choose whether to be larger or smaller randomly). Plot the straight line and also these noisy points as black stars. The resulting plot might look like this:

Explanation / Answer

x=0:1:10; %create vector x=x'; % take transpose for to be a column vector s=size(x,1); % size of x vector for i=1:s %loop over all values of x a(i)=x(i)*...; b(i)=x(i)*...; y(i)=a(i)+b(i); end plot(x,y) % plot the graph for x and y values......