vefvisit.blogg.se

Make multiple lines a comment in matlab
Make multiple lines a comment in matlab








make multiple lines a comment in matlab

#MAKE MULTIPLE LINES A COMMENT IN MATLAB CODE#

Select the code you wish to comment or uncomment, and then press Ctrl-R ( -/ for Mac) to place one '' symbol at the beginning of each line and Ctrl-T. There are two useful keyboard shortcuts for adding and removing chunks of comments. To uncomment the selected text, click the 'Uncomment' button or. In the MATLAB Editor, commented areas are printed in green by default, so they should be easy to identify. Here is a way we can write a multi-line comment in Matlab ) symbol. Alternatively, select the code and type 'Ctrl' + 'R'. To comment out multiple lines > of code, use the block comment operators. This inserts a '' symbol in front of each selected line. In that case, the second hash in the code would not start a line comment but be just some character with no special meaning whereas the second #= would open a nested multi-line comment (BTW, that name is quite unfortunate since a multi-line comment is obviously not required to span multiple lines IMHO "block comment" would have been a better choice) which would be closed by the terminating =#, thus leaving the "outer" multi-line comment unclosed. To comment out a large block of code in the Editor or Live Editor, select the code and on the 'Editor' or 'Live Editor' tab, click the 'Comment' button. While I find it convenient to be able to deactivate single lines quickly and I do use it often and also as an end-of-line comment the // proves good, if I have.

make multiple lines a comment in matlab

In particular: Should a line comment be a line comment within a multi-line comment? And should a multi-line comment be a multi-line comment within a line-comment? My personal gut feeling would answer "no" in both cases because otherwise you are likely to run into problems of "overlapping ranges" which is certainly a Bad Thing (correct me if I'm wrong - perhaps there's a way of preventing this). You should then see multiple highlighted characters. Hold down the 'Alt' Key and drag over multiple lines with the mouse. I was just curious and trying to find out whether it should be possible to nest comments of different types. Answers (1) Michael Zauner on 2 Link This feature works only in adjacent lines. Oh, I could have filed an issue, but I'm not even sure that the code should be valid in the first place.










Make multiple lines a comment in matlab