Error at '(' in first line of code
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Evan Mossel
el 9 de Jul. de 2018
Comentada: Walter Roberson
el 9 de Jul. de 2018
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 comentarios
Walter Roberson
el 9 de Jul. de 2018
https://www.mathworks.com/matlabcentral/fileexchange/56041-moon-position gives an example of calling moonpos()
Respuesta aceptada
Walter Roberson
el 9 de Jul. de 2018
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Electrical Block Libraries en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!