Skip to content

Instantly share code, notes, and snippets.

@krantikal
Last active March 31, 2021 11:43
Show Gist options
  • Save krantikal/cc222c85719a9c81733985aaec69e137 to your computer and use it in GitHub Desktop.
Save krantikal/cc222c85719a9c81733985aaec69e137 to your computer and use it in GitHub Desktop.
[Matlab Live Scripts] Notes on how to construct and deploy a #live #script

Annotation : How to work with live scripts:

  1. Home Tab, New: Live Script (.mlx extension)
  2. Live Editor / View Tab becomes active
  3. Save the Live Script
  4. Create a text-zone at the top by pressing Ctrl+E (or RC: Convert between code and text). With the live editor tab active you can click in the buttons (1) Equation via its LaTeX code(2) Hyperlink (3) Image to import them in the script. You can also do standard formatting. It is possible to create a bullet / numbered list from the "Text Style" toolbox (to the right hand side of the live editor ribbon). Code can be included within text-zones; use the big "M" (monospaced) button.
  5. Press a Ctrl+E again to insert code; Ctrl+Enter to exec. Note that the right-most end of the live editor ribbon contains more detailed "Run" Options.
  6. Create new sections (which can be run individually) if needed, to include answers to several problems. Placing the clear all command at the top of each sections can eliminate some confusion.
  7. The View tab can be used to switch between showing the output figures to the side or including them with the rest of the document (inlined figures). There two little buttons to the top right part of the editor brings this functionality within easy reach.
  8. To export to pdf/html/other supported formats using the Save options in the "FILE" zone of the Live editor tab.

See the "Relativistic velocity addition" script under Matlab for rvel.m a script that you can convert easily to a live script

%using a live script in matlab
%Dummy file, so that one can find the markdown document while searching within the Matlab language tag in my gist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment