Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Im having an issue with this matlab assignment and i get get this one string to work Here is the code: % Load satellite data

Im having an issue with this matlab assignment and i get get this one string to work

Here is the code:

% Load satellite data

url = 'https://celestrak.org/NORAD/elements/gp.php?GROUP=geo&FORMAT=tle';

sat_data = webread(url);

sat_data = splitlines(sat_data);

num_sats = numel(sat_data)/3;

% Ask user for search criteria

search_string = input('Enter search string: ', 's');

min_inc = input('Enter minimum inclination: ');

% Loop through each satellite and check if it meets the search criteria

num_matching_sats = 0;

for i = 1:num_sats

name = char(sat_data(3*(i-1)+1));

inc = str2double(char(sat_data(3*(i-1)+3)).(9:16));

if startsWith(name, search_string, 'IgnoreCase', true) && inc >= min_inc

num_matching_sats = num_matching_sats + 1;

fprintf('%d %.2f %s ', num_matching_sats, inc, name);

end

end

% Print number of matching satellites

fprintf('%d Satellites found ', num_matching_sats);

Here is the error im getting image text in transcribed

here is whats suppose to come out of the program

>> Sat_Finder_name_inc_Solution Enter search string: Enter minimum inclination: 45

1 54.21 36828 BEIDOU-2 IGSO-1 2 49.75 37256 BEIDOU-2 IGSO-2 3 60.67 37384 BEIDOU-2 IGSO-3 4 54.49 37763 BEIDOU-2 IGSO-4 5 49.87 37948 BEIDOU-2 IGSO-5 6 51.44 40549 BEIDOU-3S IGSO-1S 7 51.10 40938 BEIDOU-3S IGSO-2S 8 58.48 41434 BEIDOU-2 IGSO-6 9 55.10 43539 BEIDOU-2 IGSO-7 10 56.94 44204 BEIDOU-3 IGSO-1 11 55.14 44337 BEIDOU-3 IGSO-2 12 56.84 44709 BEIDOU-3 IGSO-3

12 Satellites found

Enter minimum inclination: 45 Argument to dynamic structure reference must evaluate to a valid field name. Error in Sat_Finder name inc_Solution (sine17) inc = str2double (char (sat_data (3(i1)+3)).(9:16))

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

Lectures On Public Economics

Authors: Anthony B. Atkinson, Joseph E. Stiglitz

1st Edition

0691166412, 978-0691166414

Students also viewed these Databases questions