Variable highlighting sometimes doesn't work (Editor)

1 visualizzazione (ultimi 30 giorni)
With some variables, clicking on them in the Editor does not highlight other occurrences of that same variable within the current script, as would be expected.
Not sure why that is the case, since those variables are no different from those for which highlighting works normally; and there are no syntax errors in my script. Any ideas? Using R2016a.
  3 Commenti
z8080
z8080 il 9 Mar 2017
That's what I suspected as well, but as I said I have no unfinished code or syntax errors!..
z8080
z8080 il 9 Mar 2017
Actually, I think it was caused by a return command I had in my script somewhere, that made some lines non-reachable - so still in the same vein. Thanks again!

Accedi per commentare.

Risposta accettata

z8080
z8080 il 9 Mar 2017
caused by a return command I had in my script somewhere, that made some lines non-reachable

Più risposte (1)

An
An il 25 Dic 2023
Modificato: An il 25 Dic 2023
It seems that only variables defined locally are highlighted. Added a "global varname" at the beginning (varname the variable that was not being hightlighted) and it started being highlighted.
Hope this helps (me) or anyone else.

Categorie

Scopri di più su Function Creation in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by