<html lang="en"> <head> <title>Single Line Comments - GNU Octave</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="GNU Octave"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Comments.html#Comments" title="Comments"> <link rel="next" href="Block-Comments.html#Block-Comments" title="Block Comments"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="Single-Line-Comments"></a> <p> Next: <a rel="next" accesskey="n" href="Block-Comments.html#Block-Comments">Block Comments</a>, Up: <a rel="up" accesskey="u" href="Comments.html#Comments">Comments</a> <hr> </div> <h4 class="subsection">2.7.1 Single Line Comments</h4> <p><a name="index-g_t_0040samp_007b_0023_007d-187"></a><a name="index-g_t_0040samp_007b_0025_007d-188"></a> In the Octave language, a comment starts with either the sharp sign character, ‘<samp><span class="samp">#</span></samp>’, or the percent symbol ‘<samp><span class="samp">%</span></samp>’ and continues to the end of the line. Any text following the sharp sign or percent symbol is ignored by the Octave interpreter and not executed. The following example shows whole line and partial line comments. <pre class="example"> function countdown # Count down for main rocket engines disp(3); disp(2); disp(1); disp("Blast Off!"); # Rocket leaves pad endfunction </pre> </body></html>