Block Comments
To make a block comment just put a ‘%{‘ in the starting of the block and ‘%}’ at the end of the block.
Syntax:
%{ multiline comment %}
Example :
MATLAB
disp( "Below is the block comment using %" ); %{ this is a comment using % %} |
Output :
Below is the block comment using %
Comments in MATLAB
Comments are generic English sentences, mostly written in a program to explain what it does or what a piece of code is supposed to do. More specifically, information that programmer should be concerned with and it has nothing to do with the logic of the code. They are completely ignored by the compiler and are thus never reflected on to the input.
In MATLAB, comments are of two types:
- Single-line Comments
- Block Comments
- Spanning MUltiple Lines