“comment” these narrative lines, to avoid any error. Therefore, we must use these lines as comments, i.e. If we try to execute our code directly, we will get a run time error in lines to lines 3 & 4 as these lines are not understandable by MATLAB’s compiler. Output 1 (After commenting on the narration lines): This is how our input and output will look like in MATLAB: Click the “Comment” button (labeled as “%” sign) present in MATLAB’s “Live Editor” tab, as shown in the image below.Select the narrative lines which we want to comment (the lines written to explain the code).Write the code along with the narration to describe it.Our purpose is to prevent our narration lines from getting executed by the compiler, for which we will “comment” the narration lines. But, first, let us write a dummy code and provide a narration that will explain our code. In the first example, we will make use of MATLAB’s “Comment” button present in the Live Editor. Let us now understand how to provide comments in MATLAB.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |