Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions