Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write some code (20 points) a. Write a script named taskla.m to find what city is served by the airprot BOB using the cell array

image text in transcribed
Write some code (20 points) a. Write a script named taskla.m to find what city is served by the airprot "BOB" using the cell array airports_cell As a practice, use a FOR loop (although not efficient) to find the city. Hint: The goal is to find the row number where the "BOB" is at in the cell array. You can use a FOOR loop to go over all the rows and compare the airport code in each row with "BOB". If it's a match, that means you have found the target row. b. Write a script named tasklb.m to find what is the country/territory of the airprot "PPT" using the structure array airports_struct. Like the previous problem, as a practice, use a FOR loop to do this. c Write a function named getGeoLoc. This function takes a string (3-letter code of an airport) as input and output the latitude AND the longitude of the airport. You can choose to either use the cell array, structure array or table to do the search. Please note: this will be a function with two output variables. To test your function, you can try: >> [la, lo] = getGeoLoc (BIM) 45.954799652099609 20 = -1.124970016479492e+02 d. Write a function named godAirports. This function takes two strings (3-letter code of an airport) as input and print the great circle distance between two airports. Hint: 1. You can call your getGeoLoc function from part.c to get the LAT and LONG of the two airports. 2. You can use your calDistance function from lab6 for the great circle distance calculation. To test your function, you can try: >> gcdAirports ("EWR', 'SIN) The distance between EWR and SIN is: 9530.21 miles Write some code (20 points) a. Write a script named taskla.m to find what city is served by the airprot "BOB" using the cell array airports_cell As a practice, use a FOR loop (although not efficient) to find the city. Hint: The goal is to find the row number where the "BOB" is at in the cell array. You can use a FOOR loop to go over all the rows and compare the airport code in each row with "BOB". If it's a match, that means you have found the target row. b. Write a script named tasklb.m to find what is the country/territory of the airprot "PPT" using the structure array airports_struct. Like the previous problem, as a practice, use a FOR loop to do this. c Write a function named getGeoLoc. This function takes a string (3-letter code of an airport) as input and output the latitude AND the longitude of the airport. You can choose to either use the cell array, structure array or table to do the search. Please note: this will be a function with two output variables. To test your function, you can try: >> [la, lo] = getGeoLoc (BIM) 45.954799652099609 20 = -1.124970016479492e+02 d. Write a function named godAirports. This function takes two strings (3-letter code of an airport) as input and print the great circle distance between two airports. Hint: 1. You can call your getGeoLoc function from part.c to get the LAT and LONG of the two airports. 2. You can use your calDistance function from lab6 for the great circle distance calculation. To test your function, you can try: >> gcdAirports ("EWR', 'SIN) The distance between EWR and SIN is: 9530.21 miles

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

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions