Go to CCP Homepage Go to Materials Page Go to Engineering Mathematics Materials Go to Table of Contents
Go Back One Page Go Forward One Page

MATLAB Tutor

Part 2: Comments

Any statement in MATLAB that is preceded by a percent sign % is treated as a comment -- that is, it is ignored by the MATLAB compiler.

  1. Enter

         % Now we will define the coefficients of the polynomial:
         a = 2;
         b = 5;
         c = 6;
  2. Enter

         n = 3   % n is the number of roots of the equation.

An entire line may be a comment, or just the second part of a line.

In Part 4 of this tutorial, you will learn how you can save the work you do during a MATLAB session into a "diary" file. You should include many MATLAB comments in your work so that later, when you read your diary file, you can see what you were doing.


Go to CCP Homepage Go to Materials Page Go to Engineering Mathematics Materials Go to Table of Contents
Go Back One Page Go Forward One Page


| CCP Home | Materials | Engineering Mathematics | Module Contents | Back | Forward |

modules at math.duke.edu Copyright CCP and the author(s), 2000