Writing a script to read input parameters for a satellite orbit from an external .txt file. Could someone correct my code?
조회 수: 1 (최근 30일)
이전 댓글 표시
![](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!