Error at '(' in first line of code
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
Walter Roberson
2018-7-9
https://www.mathworks.com/matlabcentral/fileexchange/56041-moon-position gives an example of calling moonpos()
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Function Creation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!