Error loading TLE file into satellite object
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
jose nuñez
el 24 de En. de 2024
Comentada: Andrew Mihalik
el 23 de Jul. de 2024
I'm creating a GPS scenario loading current TLE into the satellite object with following commands:
% Create Scenario
startTime = datetime('now', 'Format', 'yyyy-MM-dd HH:mm:ss');
stopTime = startTime;
sampleTime = 1; % secs
sc = satelliteScenario(startTime,stopTime,sampleTime);
% Load TLE
websave('tledata.tle', 'https://celestrak.org/NORAD/elements/gp.php?GROUP=gps-ops&FORMAT=tle');
% Put satellites into the scenario
sats = satellite(sc,'tledata.tle');
But I obtain following error:
Error using satelliteScenario/satellite>throwExceptions
Unable to add satellite to the satelliteScenario.
Error in satelliteScenario/satellite
Caused by:
Incorrect size for expression 'time.fmt': expected [1x0] but found [1x19].
Has anyone an idea on what's going on? TLE file seems to be OK.
1 comentario
Andrew Mihalik
el 23 de Jul. de 2024
Hello, if we assume I ran the following code:
sc = satelliteScenario;
StartTime_datestring= '2024-07-22 17:52:39'
StopTime_datestring= '2024-08-23 17:52:39'
Can anyone explain why, then, this code executes correctly and without error:
StartTime_datetime=datetime(StartTime_datestring,'InputFormat','yyyy-MM-dd HH:mm:ss');
StopTime_datetime=datetime(StopTime_datestring,'InputFormat','yyyy-MM-dd HH:mm:ss');
sc.StartTime=StartTime_datetime
sc.StopTime=StopTime_datetime
But this code:
StartTime_datetime=datetime(StartTime_datestring,'Format','yyyy-MM-dd HH:mm:ss');
StopTime_datetime=datetime(StopTime_datestring,'Format','yyyy-MM-dd HH:mm:ss');
sc.StartTime=StartTime_datetime
sc.StopTime=StopTime_datetime
creates an error saying Incorrect size for expression 'time.fmt': expected [1x0] but found [1x19].
Respuesta aceptada
Varun
el 29 de En. de 2024
Hi Jose,
Looks like the error is related to the size of the 'time.fmt' field in the TLE file. The expected size is [1x0], but the error indicates that it found [1x19].
I debugged the code and found that the error is occurring due to the first line because of using ‘Format’ name-value pair in the ‘datetime’ function:
startTime = datetime('now', 'Format', 'yyyy-MM-dd HH:mm:ss');
To resolve this error, you can simply replace this line with the following line which is independent of ‘Format’ name-value pair:
startTime = datetime('now');
Please refer to the following documentations to learn more:
‘satelliteScenario’: https://www.mathworks.com/help/aerotbx/ug/satellitescenario.html
Hope it helps.
2 comentarios
Andrew Mihalik
el 23 de Jul. de 2024
Hello, if we assume I ran the following code:
sc = satelliteScenario;
StartTime_datestring= '2024-07-22 17:52:39'
StopTime_datestring= '2024-08-23 17:52:39'
Can anyone explain why, then, this code executes correctly and without error:
StartTime_datetime=datetime(StartTime_datestring,'InputFormat','yyyy-MM-dd HH:mm:ss');
StopTime_datetime=datetime(StopTime_datestring,'InputFormat','yyyy-MM-dd HH:mm:ss');
sc.StartTime=StartTime_datetime
sc.StopTime=StopTime_datetime
But this code:
StartTime_datetime=datetime(StartTime_datestring,'Format','yyyy-MM-dd HH:mm:ss');
StopTime_datetime=datetime(StopTime_datestring,'Format','yyyy-MM-dd HH:mm:ss');
sc.StartTime=StartTime_datetime
sc.StopTime=StopTime_datetime
creates an error saying Incorrect size for expression 'time.fmt': expected [1x0] but found [1x19].
Más respuestas (0)
Ver también
Categorías
Más información sobre Satellite Mission Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!