Unbalanced or unexpected parenthesis or bracket.

9 vues (au cours des 30 derniers jours)
Jorge Enrique  Mesa Mosuqera
Jorge Enrique Mesa Mosuqera le 27 Juin 2016
Modifié(e) : Thorsten le 1 Juil 2016
Hello. I have downloaded an old Matlab version. I a buddy send me a L-SLAM algorithm that he developed at Greek university. I want to test it but it throws this error: Unbalanced or unexpected parenthesis or bracket.
The error is in my main.m at 19 line
I am working with Windows XP using R2009A matlab version.
I will attach the file. If somebody wants the whole source code send me a email to enriquemesa2015@gmail.com
  1 commentaire
Guillaume
Guillaume le 27 Juin 2016
Any reason why you're using such an ancient version? It's obviously not compatibility concerns since the code you're running targets a more recent version.

Connectez-vous pour commenter.

Réponses (1)

Thorsten
Thorsten le 27 Juin 2016
If you have a pre-2009b version, the tilde could cause the error. Replace each tilde ~ with something like dummy or variable_not_used, and see if it works.
  2 commentaires
Jorge Enrique  Mesa Mosuqera
Jorge Enrique Mesa Mosuqera le 27 Juin 2016
Hello, I am not a good english speaker. Can you explain me what is the goal of tilde?? Can a replace it by a variable filled with zero?? I don't know the semantic meaning of tilde. Thanks for your answer. I have no reason to still using R2009A version. Just looking a way to work without reinstall Matlab. Can you give a example of a corrected statement??
Thorsten
Thorsten le 1 Juil 2016
Modifié(e) : Thorsten le 1 Juil 2016
"Use the ~ notation to denote missing inputs in function declarations, and missing outputs in calls to functions..."
You can replace any tilde used this way simply with "noticed" or "dummy", a variable that you never use and can clear immediately
In your main.m, replace
[d,th,~]=getMeasure(map,realPosition,phi);
and
[~,midx]=max([prt.w]);
with
[d,th]=getMeasure(map,realPosition,phi);
(Because it is the final variable, simple delete the tilde.)
and
[notused, midx]=max([prt.w]);
clear notused
But be aware that the ~ is also used to as a negate operator, you you cannot do the replacement without checking each instance of the ~ carefully.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Text Data Preparation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by