Versions Compared

Key

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

...

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

Are these the values you expect?

The Workspace window shows all the currently defined variables. If you don't see this window, select Desktop > Workspace so that a tick mark appears next to the window name.

...

We'll create a MATLAB program to calculate R using the above three statements. Nothing fancy here: the program will just be a text file with the above statements. Such a file is called an M-File. Let's take a peek at the documentation on M-Files. In the Help window, select

Contents (tab) > MATLAB > Programming > M-File Programming > Working with M-files

...

Bring up the Editor: Select the Command window Window by clicking in it. In the MATLAB GUI, select

...

Add comments to your program to lay out, in a human language, what it does. Comments are prefixed with a %; See below.

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.

...