Find the source of output in Command window

11 visualizaciones (últimos 30 días)
Zicheng Cai
Zicheng Cai el 9 de Jul. de 2018
Editada: OCDER el 9 de Jul. de 2018
The code I wrote was quite lengthy. There is a number "2" that keep appearing during iterations. I think I forgot to type ";" somewhere. I am wondering if there is a command that can help me find the source of the problem.

Respuestas (1)

OCDER
OCDER el 9 de Jul. de 2018
Editada: OCDER el 9 de Jul. de 2018
You probably have to write a custom script to search all your code for the semicolon error. See this Q&A which provides a starting point for doing this.
The other way is the use the Matlab Editor, side bar on the right that shows a orange bar for warning/suggestions. An orange line will appear if you forgot to add semicolon. Maybe the line you need to fix is highlighted in orange. Hopefully there isn't too many orange lines...
  2 comentarios
Guillaume
Guillaume el 9 de Jul. de 2018
Another option is to call mlint directly. This will give the same warnings as these orange/yellow (they look orange to me!) lines but in a text form.
OCDER
OCDER el 9 de Jul. de 2018
Nice! Seems like mlint is now checkcode https://www.mathworks.com/help/matlab/ref/checkcode.html
The warnings are indeed orange. I had to create a lot of mistakes to see the orange hue.

Iniciar sesión para comentar.

Categorías

Más información sobre Desktop en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by