Start with this:lab_2_start.m
Download lab_2_start.m
and complete the unfinished lines.
This pdf describes how to read data from a url:web-read.pdf
Download web-read.pdf
The url we will read data from is :
https://celestrak.com/NORAD/elements/tle-new.txt(Links to an external site.)
Write a program that uses an input function to read an index number from the user, and prints the data for the selected satellite in the format used for assignment 1.
The program will read data into a variable namedsat_list, which will then be a vector of strings. Every 3 lines represents one satellite. You can read access a line of data as shown in the pdf:
sat_list(i)is line i from the data.
Satellite 1 will have it's name, TLE line 1 and TLE line 2 in
sat_list(1)
sat_list(2)
sat_list(3)
Satellite 2 will have it's name, TLE line 1 and TLE line 2 in
sat_list(4)
sat_list(5)
sat_list(6)
So if the number the user enters is saved in variablen, you need to compute the three index numbers fromn.
Store the three lines in string variables namedname, line_1andline_2, just like in assignment 1, but instead of using string literals, use thesat_list:
name = sat_list(1);
will put the name of satellite 1 into the name variable.
Here is an example program to illustrate the input function and using an index on a vector:indexing_1.m
Download indexing_1.m