Writing a script to read input parameters for a satellite orbit from an external .txt file. Could someone correct my code?
1 回表示 (過去 30 日間)
古いコメントを表示
Christopher Maraj
2018 年 3 月 11 日
コメント済み: Walter Roberson
2018 年 3 月 12 日
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171152/image.png)
2 件のコメント
Walter Roberson
2018 年 3 月 11 日
I see that you edited the question, but it is not obvious to me what has changed. The suggestions I made earlier still apply.
採用された回答
Walter Roberson
2018 年 3 月 11 日
- 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 件のコメント
Walter Roberson
2018 年 3 月 12 日
You need to put file names in ''
read_input('satellite_data.txt',3)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で String Parsing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!