Borrar filtros
Borrar filtros

this code is meant to prompt user for longitude and latitude values,and find looks angles but it wont run,please help

2 visualizaciones (últimos 30 días)
clc
clear all
close all
earth_station_longitude=input('prompt');
earth_station_latitude=input('prompt');
sub_satellite_latitude=input('get longitude');
B=earth_station_longitude-s_s_latitude
b=acosd(cosd(Earth_station_latitude)*cosd(B))
a=42164
R=6371
elevation_angle=acosd((a*sind(b))/range)
range=sqrt(R^2+a^2-2*R*a*cosd(b))
A=asind(sind(abs(B))/sind(b))
if(Earth_station_latitude<0)&&(B<0)
AZ=A
elseif(Earth_station_latitude>0)&&(B<0)
AZ=180-A
elseif(Earth_station_latitude>0)&&(B>0)
AZ=180+A
else
AZ=360-A
end
  1 comentario
Walter Roberson
Walter Roberson el 5 de Mayo de 2022
B=earth_station_longitude-s_s_latitude
s_s_latitude is not defined
b=acosd(cosd(Earth_station_latitude)*cosd(B))
Earth_station_latitude with a capital E is not defined. Variable names are case sensitive.

Iniciar sesión para comentar.

Respuestas (1)

Aashita Dutta
Aashita Dutta el 10 de Mayo de 2022
Hello!
I understand that you are facing issues while running the code, where the user is prompted to enter latitude and longitude values and calculate the angles based on the input arguments.
I have tried to execute the code and found that there are some lexical/syntactical errors in the code, like “s_s_latitude” is undefined and variables name are case sensitive.
Please find the excutable code below:
clc
clear all
close all
earth_station_longitude=input('prompt');
earth_station_latitude=input('prompt');
sub_satellite_latitude=input('get longitude');
B=earth_station_longitude-sub_satellite_latitude
b=acosd(cosd(earth_station_latitude)*cosd(B))
a=42164
R=6371
range=sqrt(R^2+a^2-2*R*a*cosd(b))
elevation_angle=acosd((a*sind(b))/range)
A=asind(sind(abs(B))/sind(b))
if(earth_station_latitude<0)&&(B<0)
AZ=A
elseif(earth_station_latitude>0)&&(B<0)
AZ=180-A
elseif(earth_station_latitude>0)&&(B>0)
AZ=180+A
else
AZ=360-A
end
Thank you

Categorías

Más información sobre Satellite Mission Analysis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by