Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Task 2 Download the lab4_plot_data.txt file from Moodle. The file contains the x (first row) and y (second row) coordinates. Write MATLAB m-file that...

Task 2  

Download the lab4_plot_data.txt file from Moodle. The file contains the x (first row) and y (second row) coordinates.  

Write MATLAB m-file that performs the following: 

1. Read the data points from lab4_plot_data.txt 2. Plot y against x using red circle markers. 3. On the same figure, plot the function sin(x) as a black continuous line. Remember to include a legend and place it in the bottom left corner. 

Do not forget to label your plots. Use either the fgetl() or the importdata() functions to import your data.  

Task 3 It turns out that some values in lab4_plot_data.txt vary too much from the sin(x) curve and should be removed as they are considered noisy (invalid). You are tasked with the following: 

a) Remove the noisy data using the following rules. Do not set the invalid data points to 0, [] or NaN! Use logical statements in addition to true (1) and false (0) values to complete the task. a. An absolute difference of 0.4 or greater between the data point and the sin(x) value is deemed noisy b. The 11th, 59th and 88th data points are also deemed noisy. b) Plot the valid (noiseless) data points as blue circles on the same figure produced in Task 2. Therefore, the red circles now represent the noisy data while the blue circles represent the valid data. Remember to include a legend. 

  • Attachment 1
  • Attachment 2
  • Attachment 3
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question