Error at '(' in first line of code

3 ビュー (過去 30 日間)
Evan Mossel
Evan Mossel 2018 年 7 月 9 日
コメント済み: Walter Roberson 2018 年 7 月 9 日
I am getting several errors on this line of code. The first is a error at '(' between size and 1. The next is at the ')' at the end of the line. Please help me understand what I am missing The input for the moonpos function is (vector of julian days in TDT time scale; output coordinate type). There could be a problem with the input but I am not sure.
function [X,Y,Z]=moonpos(size(1);elpdt)
  4 件のコメント
Evan Mossel
Evan Mossel 2018 年 7 月 9 日
編集済み: Walter Roberson 2018 年 7 月 9 日
I tried to search through the library https://www.mathworks.com/matlabcentral/fileexchange/56041-moon-position to find when the moonpos inputs are defined. Thst was the best I could come up with. I am not sure how else to define a time vector.
Walter Roberson
Walter Roberson 2018 年 7 月 9 日

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2018 年 7 月 9 日
function [X,Y,Z] = moonpos(julian_days, elpdt)
When you are declaring or calling a function, you must use comma between arguments, not semi-colon.
When you are declaring a function, the list of parameters in () must be pure variable names or the character ~ (by itself), not expressions.
In MATLAB, you do not declare the sizes of the parameters in the function declaration.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFunctions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by