How to perform access simultaneously for multiple groundstations?
Show older comments
Hello,
I am trying to create an access table for multiple groundstations, but I've been getting this error:
"Error using access
Expected input number 2, OBJ2, to be a scalar.
Error in matlabshared.satellitescenario.internal.AddAssetsAndAnalyses.access
Error in matlabshared.satellitescenario.internal.PrimaryAsset/access"
Here is the code:
%Create Sat scenario
startTime = datetime(2021,6,02,8,23,0);
stopTime = startTime + hours(60);
sampleTime = 60;
sc = satelliteScenario(startTime,stopTime,sampleTime);
a = 800e3; e = 0; i = 96; raan = 100; aop = 90; ta = 0;
sat = satellite(sc,a_m,e,i,raan,aop,ta);
show(sat);
groundTrack(sat,"LeadTime",1200)
time = datetime(2021,6,02,12,30,0);
pos = states(sat,time,"CoordinateFrame","geographic");
%add ground stations
name = ["Svalbard, Norway","Tromso, Norway", "Inuvik,Canada",...
"Puertollano,Spain", "Athens,Greece","Los Angeles,USA",...
"Hartebeesthoek,S.Africa","Awarua,New Zealand","Punta Arenas,Chile",...
"Troll,Antartica", "Jeju, S.Korea"];
lat = [78.2, 69.6, 68.2,38.7,37.5,34.0,-25.8, -46.5,-53, -72.0,33.5];
lon = [15.3, 19.0,-133.3,-4,22.4,-118.3,27.7,168.4,-70, 2.5,126.8];
gs = groundStation(sc,"Name",name,"Latitude",lat, ...
"Longitude", lon);
And this is how I am doing the access:
ac = access(sat, gs);
intvls = accessIntervals(ac)
I would like something similar to the image attached, but showing other groundstations

Answers (1)
Aravind
on 18 Oct 2024
0 votes
It seems you want to create a table of access intervals for the connections between a specific satellite and multiple ground stations. According to MathWorks documentation at https://www.mathworks.com/help/releases/R2021a/aerotbx/ug/satellitescenario.groundstation.access.html?s_tid=doc_ta#mw_a20f3494-4190-410d-85e5-cc869ea44649, the "access" function requires scalar objects of the "Satellite", "GroundStation", or "ConicalSensors" classes as inputs. The error you encountered arises because your code is passing a vector of "GroundStation" objects instead of individual ones.
To resolve this, you can use a "for" loop to iterate through each "GroundStation" object in your vector. For each ground station, create an access analysis object and compute the access intervals. Collect all the access intervals and aggregate them into a single table.
This approach should help you generate the desired table of access intervals for the satellite-ground station links.
I hope this clarifies your issue.
Categories
Find more on Satellite Mission Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!