Borrar filtros
Borrar filtros

Writing a script to read input parameters for a satellite orbit from an external .txt file. Could someone correct my code?

1 visualización (últimos 30 días)
  2 comentarios
Walter Roberson
Walter Roberson el 11 de Mzo. de 2018
I see that you edited the question, but it is not obvious to me what has changed. The suggestions I made earlier still apply.
Christopher Maraj
Christopher Maraj el 11 de Mzo. de 2018
The edit was just to the question itself, not the code. Im unsure as to how to implement your suggestions in the code so i was asking for someone to edit it for me

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 11 de Mzo. de 2018
  • When you detect invalid input you should probably error()
  • Your code is overwriting your complete variables sat_id, Xo, and so on, every iteration of the loop. You probably want to be assigning to sat_id(n), Xo(n) and so on.
  4 comentarios
Christopher Maraj
Christopher Maraj el 11 de Mzo. de 2018
thank you. Ive also encountered an error where it can't access the .txt file: read_input(satellite_data.txt,3)
Undefined variable "satellite_data" or class "satellite_data.txt".
Any suggestions on how to solve this?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre String Parsing 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