필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
  댓글 수: 2
Walter Roberson
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.
Christopher Maraj
Christopher Maraj 2018년 3월 11일
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

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
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
Christopher Maraj
Christopher Maraj 2018년 3월 11일
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?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by