Versions Compared

Key

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

...

Save and run beam4.m again. You should still get the same results. We can now move on to the next part of the tutorial.

Save the contents of a matrix to a text file

Just as you can read in values from a text file to a matrix, you can also write a matrix to a text file. The function for this is call dlmwrite.

Output Important Values in Command Window

The next step is to print out data in the command window. Suppose we are asked to report the numerical values of the bending stress for inner radius =0.5, 1.0, and 1.5 cm. These values are already contained in the vectors "ri" and "sigma_x".

...