Error in code, parenthesis perceiving as comment for some reason

1 visualización (últimos 30 días)
Yohan
Yohan el 28 de Abr. de 2024
Movida: Matt J el 29 de Abr. de 2024
If a run the following code I get a following comment:
Line 17: A '(' might be missing a closing ')'.
causing invalid syntax at end of line. Line 17 is
Q_est = updateQ(...),
and this warning also shows in line 18 and 19 too. Does anyone know what is the problem? Here we cannot see it, but if I run this code in MATLAB the last parenthesis is shown in green and perceived as a comment for some reason.
for i = 1:numIterations
beta_est = updateBetaUsingCarterKohn(Y, X, alpha_est, beta_est, Q_est, R_est);
Q_est = updateQ(...)
R_est = updateR(...)
alpha_est = updateAlpha(...)
end

Respuestas (1)

Stephen23
Stephen23 el 28 de Abr. de 2024
Movida: Matt J el 29 de Abr. de 2024
Explanation: for some reason you seem to be running this literal code:
Q_est = updateQ(...)
instead of calling UPDATEQ etc. with any inputs that they require. The reason why the closing parenthesis is green like a comment is because it is a comment: you defined it as a comment by using the ellipsis, exactly as explained in the documentation:
Solution: call the function with inputs, rather than with superfluous ellipses.

Categorías

Más información sobre Quadratic Programming and Cone Programming 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!

Translated by