Run Sections in Live Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19-13
Divide Your File Into Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-13
Evaluate Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-13
Debug Code in the Live Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-15
Show Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-15
Debug Using Run to Here . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-16
View Variable Value While Debugging . . . . . . . . . . . . . . . . . . . . . . 19-18
Pause a Running File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-18
End Debugging Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-18
Step Into Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-19
Add Breakpoints and Run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-19
Modify Figures in Live Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-23
Explore Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-23
Update Code with Figure Changes . . . . . . . . . . . . . . . . . . . . . . . . 19-25
Add Formatting and Annotations . . . . . . . . . . . . . . . . . . . . . . . . . 19-25
Add and Modify Multiple Subplots . . . . . . . . . . . . . . . . . . . . . . . . 19-27
Save and Print Figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-31
Format Files in the Live Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-32
Change Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-34
Autoformatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-35
Insert Equations into the Live Editor . . . . . . . . . . . . . . . . . . . . . . . 19-38
Insert Equation Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-38
Insert LaTeX Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-40
Add Interactive Controls to a Live Script . . . . . . . . . . . . . . . . . . . . 19-47
Insert Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-47
Modify Control Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-49
Modify Control Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-49
Create Live Script with Multiple Interactive Controls . . . . . . . . . . 19-50
Share Live Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-51
Add Interactive Tasks to a Live Script . . . . . . . . . . . . . . . . . . . . . . . 19-53
What Are Live Editor Tasks? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-53
Insert Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-53
Run Tasks and Surrounding Code . . . . . . . . . . . . . . . . . . . . . . . . . 19-56
Modify Output Argument Name . . . . . . . . . . . . . . . . . . . . . . . . . . 19-57
View and Edit Generated Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-57
Create Live Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-59
Create Live Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-59
Add Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-59
Add Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-60
Run Live Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-60
Save Live Functions as Plain Code . . . . . . . . . . . . . . . . . . . . . . . . 19-61
Add Help for Live Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-62
Share Live Scripts and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-66
Hide Code Before Sharing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-67
xvi Contents