Writing a script to read input parameters for a satellite orbit from an external .txt file. Could someone correct my code?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Christopher Maraj
am 11 Mär. 2018
Kommentiert: Walter Roberson
am 12 Mär. 2018
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171152/image.png)
2 Kommentare
Walter Roberson
am 11 Mär. 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.
Akzeptierte Antwort
Walter Roberson
am 11 Mär. 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 Kommentare
Walter Roberson
am 12 Mär. 2018
You need to put file names in ''
read_input('satellite_data.txt',3)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu String Parsing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!