Question: Help with matlab help w/ matlab help with matlab by creating the functions in the picture and testing it with the test cases provided. One

Help with matlab
Help with matlab help w/ matlab help with matlab by creating the
functions in the picture and testing it with the test cases provided.
help w/ matlab
help with matlab by creating the functions in the picture and testing it with the test cases provided.

One real-life application of solving linear systems is GPS localization. For simplicity, let us work in a 2D world first. Suppose your cellphone receives signals from three GPS satellites at known positions A= (a, a2), B = (b1,b2), and C = (C1,C2), and can measure its distances TA, 7B, rc from all of them, as shown below. C=(q,c)=(-11,6) (x,y) A=(a,,a,) =(4,5) 16=13 =5 = 5 B =(5,6)=(5,-2) This gives us three quadratic equations for our own position P = (x, y): r = (a1 - x)2 + (az - y), re = (b x)2 + (b2 - y)?, ra = (C1 - x)2 + (c2 - y)?. (la) (1b) (1c) Subtracting equation (la) from equation (1b) and equation (1b) from equa- tion (lc), then simplifying, gives us a 2 x 2 linear system in r and y: re-r = 2(Q1 - b)r +2(a2 - B2]y-a- a + b +63 (2a) r - r = 2(6-1) +2b2 - 2)y-6-b3+ 4+ (26) Since this is a system of linear equations, it can be expressed in matrix form, (3) for some matrix and some vector on the right-hand side that you should be able to figure out. Your task in this part of the assignment is to implement this method in MATLAB (in gps2D.m and gps3D.m). That is, given the points A, B, C and distances TA,MB, rc, you will have to: 1. construct the matrix and the right-hand side vector in (3) corresponding to the linear system (2a)-(2b), 2. pass this matrix and vector to the solve function (already provided in the zip file) to obtain the point P. Note: if you did not get your my rref function to work, you can change it to the MATLAB built-in rref in the solve function in solve.m. Exactly the same approach also works in 3D, except we will now need our distances from four known points A = (Q1, 02, 03), B = (b1,b2,63), C = (1, C2, C3), and D = (di, dy, d3). Your second task is to work out the analogous equations to (2a)-(2b), and implement another program that works in 3D Specification: function P - gps2d(a, b, c, ra, rb, rc) Input: The 2D coordinates of three points A, B, C, and their distances rA, 7B, rc from an unknown point P. Output: The 2D coordinates of the point P. function p = gps3d(a, b, c, d, ra, rb, rc, rd) Input: The 3D coordinates of four points A, B, C, D, and their distances TA, 18, rc, to from an unknown point P. Output: The 3D coordinates of the point P. Test cases: gps2([4;5), (5,-2), (-11;6], 5, 5, 13) should return the vector (1:1). gps3d([6;-3;3), (-1;-6;5), (-5;4;7], [6;8;4], 5, 7, 9, 9) should re- turn [2;0;3] In general, you can create a random 2D vector with entries between say 0 and 10 by using a - 10 rand(2,1). Do this four times for a, b, c, and p, and set ra - norn(a - p) and so on. (The norm function returns the length of a vector.) Then check whether gps2d(a, b, c, ra, rb, rc) gives you back p

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!