MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

Create an Interactive Narrative with the Live Editor


The following is an example of how to use the Live Editor to create an interactive
narrative. Create an interactive narrative to tell a story with computations that you have
used to solve a problem. This example shows how to:


  • Use formatted text to describe your approach.

  • Show output together with your MATLAB code.

  • Use equations to describe the underlying mathematics.

  • Include images to illustrate important points.

  • Provide hyperlinks to background material.

  • Let the reader modify parameters and re-run the analysis.

  • Include plots for visualization.

  • Invite colleagues to extend your analysis.


The Overall Approach

In the Live Editor, you can include formatted text as part of the interactive narrative. Use
bold, italic, and underlined text to highlight important words or ideas. Use bullets or
numbers to format lists.

In this example we will estimate the power output from a typical solar panel installation.
We will use 12 noon on June 1st in Boston to illustrate how to calculate the following:


  • Solar time

  • Solar declination and solar elevation

  • Air mass and the solar radiation reaching the earth's surface

  • Radiation on a solar panel given its position, tilt, and efficiency

  • Power generated in a day and over the entire year


We will use these formulas to plot solar and panel radiation for our example day, and then
plot the expected panel power generation over the course of a year. We'll use two
MATLAB functions created for this analysis, solarCorrection and panelRadiation,
to streamline the analysis.

Create an Interactive Narrative with the Live Editor
Free download pdf