MATLAB: What does the string #ok mean in the code editior

file editorMATLAB

I have a m file that is sprinkled with lines such as…
some code % #ok<NASGU> what does this mean?

Best Answer

Matlab's code analyzer, mlint, includes a wide range of warning messages about possible problems or inefficiencies in the analyzed m-file.
NASGU indicates the value assigned to variable name might be unused. Putting %#ok<NASGU> in a line of code tells mlint not to worry about this particular issue, on this line. You can see all the warnings as orange little tick marks near the scroll bar of the m-file. Red lines indicate syntax and other errors.
See this page for more information: Check for warnings and errors