Question: This homework came with a file called data.txt , which contains coordinates of N = 1 0 0 0 points in two dimensions. Line i

This homework came with a file called data.txt, which contains coordinates of N=1000 points in two dimensions. Line i in the file has two numbers, xi and yi, which are the coordinates of point i. Write and run a Matlab program that reads this file (use the load function) and performs the following tasks. In your .pdf file submission, make sure you include a description of your approach, your commented source code, all answers, and the figure.
a) Computes and prints the range, mean, and median of the y coordinates, without using the built-in mean or median functions. You can use the functions min, max, sort.
b) Plots all points in the (x,y) plane using symbols based on the x values: blue squares, red circles, green triangles, magenta stars for the first, second, third, and fourth quartiles of the x value, respectively. Note, the first quartile contains the quarter of the points that have the lowest x value, etc. You may find the function sortrows helpful.
c) Computes a linear fit of the (x,y) data, prints out the slope and y intercept of the line, and plots the line on the same figure as the data symbols. You can use the polyfit function.
 This homework came with a file called data.txt, which contains coordinates

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!