Is there a way in Matlab or Octave to check if a string is or contains a comment? Some similar to iscomment()
.
It is easy to check in the case we deal with comment lines where the comment identifier is at the beginning, using first strtrim()
for blank elimination and then strfind()
for search the comment identifier. But the problem is difficult when a comment is after a sentence or when the comment character is used in the string with other meaning, as, for example, in the fprintf() function for data format definition