Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Calculate the reaction matrix R using the {{color:#660099}} operator by entering R = A\B.

Are these the values you expect?

...

In the Editor, enter the above three statements (you can be lazy like me and copy-and-paste from the Command History; hold down the Ctrl-key to select multiple statements simultaneously). In addition add the clear all and clear commands at the top to start with a clean slate.
Image Removed Image Added
Save this file: File > Save

...

Let's say we don't want the values of A and B reported each time we run this program. To suppress the reporting of A and B values, add a semi-colon at the end of the statements for creating A and B. Image Removed Image Added
Save and run the program again, this time using the Run icon in the Editor. Check the result in the Command window.

Add comments to your program to lay out, in a human language, what it does. Comments are prefixed with a %; See below. Image Removed Image Added
Any line beginning with a % will be skipped over by MATLAB; these are for human eyes only. You should libreally add comments to your program to remind yourself what it does. Otherwise, a few months (or days!) down the line, you'll look at it, wonder what all the fuss is about and curse the ^&^*%%&* author.

...