Then you can simply type type myfoo within a code block. The contents of myfoo.m

Notes. Suppose that you have written a function as a separate function m-file, myfoo.m and now you want to include its contents within your homework live script, HW2_Kim.mlx. At the top of MATLAB window, click on Insert > Code Example. It creates a blank box. Any text typed within this box will be formatted in monospaced fonts with syntax highlighting. Drawbacks: Still suppose that you have a function written as a separate m-file titled myfoo.m. Then you can simply type type myfoo within a code block. The contents of myfoo.m will be printed out in your live script. Note: Drawbacks: Instead of writing a separate m-file, you may just write the function at the very bottom of the document. The functions are local to the live script, and so you are able to call the function anywhere inside the live script. This way, your mlx file is fully self-contained and you no longer need to go back and forth between Editor and Live Editor. See the live script accompanying Lecture 9; all functions defined for the live script are gathered in the last section titled “Functions Used”. This is my recommended method! The only caveat I can think of: Guide video link: https://www.youtube.com/watch?v=lIw-cGEDSO0 https://www.youtube.com/watch?v=JjJADydaQBk https://www.youtube.com/watch?v=iG-Pye1EcbU https://www.youtube.com/watch?v=S1tpRlp1lHI https://www.youtube.com/watch?v=Dfz8BPRykS4 https://www.youtube.com/watch?v=4BXhz_kRB2c