Versions Compared

Key

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

...

Essentially, we need to repeat our previous calculation of σx at O for a range of rivalues. One way to do this is to loop over the previous calculation. Let's check the documentation to see what MATLAB provides for loops.

Help > Index (tab)

Search index for loops.

There are two types of loops: for and while. Bring up the documentation for the for loop and look at the first example. This shows the format of the for loop. It is noted on this page that "You can often speed up the execution of MATLAB code by replacing for and while loops with vectorized code". That is what we'll do in Step 4. Let's stick it out with slowpoke for loop for now.

...

Let's pick MATLAB's brain on how to make a plot. Wiki Markup*

  • Help

...

  • >

...

  • ( contents tab)

...

  • > matlab > getting started > graphics > using basic plotting functions*

These help pages contain a lucid description of the extensive plotting capabilities available in MATLAB. When looking for plotting help, this would be the first place to turn to.

...