Main Content

Create Runnable Examples Using the Live Editor

In the Live Editor, you can create documentation for your code that includes runnable code examples. To allow your users to experiment with different inputs to your code, include interactive controls in the examples. You can then distribute the documentation with your code to help make your code more useable.

This example uses formatted text, equations, and runnable code to document the sample function estimatePanelOutput. The sample documentation includes runnable examples with edit fields and a numeric slider that allow users of the function to experiment with different function inputs.

To view and interact with the controls in the sample documentation, open this example in MATLAB®.

Sample documentation for estimatePanelOutput function with an Overview section and an Examples section containing one example. The example calls estimatePanelOutput with sample input selections from multiple controls and shows resulting output.controls with sample input selections, and a call to the estimatePanelOutput s several controls containing

Related Topics