Why the underscore is red?

When typing, Why the underscore is in red and i always fail to call a variable due to this problem? How can i fix it?

Respuestas (1)

Star Strider
Star Strider el 27 de Mayo de 2019

0 votos

That usually means that the underscore you are using is not part of the ASCII character set MATLAB recognises.
The correct underscore is:
undscr = char(95);
and the minus sign or hyphen is:
hyphn = char(45);

2 comentarios

Simone Fiorani
Simone Fiorani el 27 de Mayo de 2019
Thanks for the answer. If i write in the command window
undscr = char(95)
matlab answers
undscr =
'_'
so i think that the underscore is associated to the rigth ASCII value. The minus sign is correct, too.
The problem suddenly appeared while i was coding. In the previous line there was no problem, in the next one the underscore started to be in red. I don't know what happened.
Star Strider
Star Strider el 27 de Mayo de 2019
Without seeing your code, I don’t either.
However, it is likely that you either left off a closing parenthesis or square bracket or curly bracket, or some other error that caused the mlint or related functions to detect an error in the previous line. Be certain everything is correct iun the previous line, and the problem will likely not recur.

Iniciar sesión para comentar.

Categorías

Más información sobre Downloads en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 27 de Mayo de 2019

Comentada:

el 27 de Mayo de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by