accessIntervals Function: Subscripting into a Table Using One Subscript Error

14 vues (au cours des 30 derniers jours)
Bara'ah
Bara'ah le 6 Jan 2025
Problem Description:
I am working on a MATLAB project involving the Satellite Communications Toolbox. My script uses the accessIntervals function to compute access intervals for satellites and ground stations. However, I consistently encounter the following error:
sql
Copy code
Subscripting into a table using one subscript (as in t(i)) is not supported. Specify a row subscript and a variable subscript, as in t(rows,vars). To select variables, use t(:,i) or for one variable t.(i). To select rows, use t(i,:).
Steps to Reproduce:
  • I created a satellite scenario with the following setup:matlabCopy
codestartTime = datetime(2024, 1, 6, 23, 23, 0);
stopTime = startTime + hours(24);
sampleTime = 60;
sc = satelliteScenario(startTime, stopTime, sampleTime);
sat = walkerDelta(sc, 570e3 + 6378.14e3, 70, 720, 36, 1, ArgumentOfLatitude=15, Name="Starlink");
gs = groundStation(sc, "Name", "Test Station", "Latitude", -35.40139, "Longitude", 148.98167);
ac = access(sat, gs);
  • I attempted to call accessIntervals for the Access object:matlabCopy code
Test = accessIntervals(ac(1));
  • The error occurs for all Access objects (ac).
Debugging Steps Taken:
  • I confirmed the Access objects (ac) are valid and properly initialized:matlabCopy codeAccess Object 1:
Access with properties:
Sequence: [1 721]
LineWidth: 3
LineColor: [0.3922 0.8314 0.0745]
  • The error persists for all Access objects.
Questions:
  1. Is this a known issue with accessIntervals or the Satellite Communications Toolbox?
  2. How can I resolve or work around this error to compute access intervals?
  3. Are there alternative methods to compute satellite-ground station access intervals if accessIntervals cannot be used?
Environment: Matlabonline

Réponses (1)

Altaïr
Altaïr le 8 Jan 2025
Modifié(e) : Altaïr le 8 Jan 2025
The following code executed in MATLAB Online without any errors:
startTime = datetime(2024, 1, 6, 23, 23, 0);
stopTime = startTime + hours(24);
sampleTime = 60;
sc = satelliteScenario(startTime, stopTime, sampleTime);
sat = walkerDelta(sc, 570e3 + 6378.14e3, 70, 720, 36, 1, ArgumentOfLatitude=15, Name="Starlink");
gs = groundStation(sc, "Name", "Test Station", "Latitude", -35.40139, "Longitude", 148.98167);
ac = access(sat, gs);
Test = accessIntervals(ac(1))
The error Subscripting into a table using one subscript (as in t(i)) is not supported, typically occurs when a table object isn't indexed correctly. The following MATLAB Answer is an example:
The access function returns a matlabshared.satellitescenario.Access object, not a table. However, the accessIntervals function returns a table object, and indexing it with a single subscript, as shown below, may lead to the error.
Test(1)
For more details on the output types of the access and accessIntervals functions, please refer to these documentation pages:

Catégories

En savoir plus sur Scenario Generation and Visualization dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by