Error in code, parenthesis perceiving as comment for some reason

1 回表示 (過去 30 日間)
Yohan
Yohan 2024 年 4 月 28 日
移動済み: Matt J 2024 年 4 月 29 日
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

回答 (1 件)

Stephen23
Stephen23 2024 年 4 月 28 日
移動済み: Matt J 2024 年 4 月 29 日
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.

カテゴリ

Help Center および File ExchangeQuadratic Programming and Cone Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by