Create Live Script To create a live script in the Live Editor, go to the Home tab and click New Live Script. You also can use the edit function in the Command Window.
For example, type edit penny.mlx to open or create the file penny.mlx. To ensure that a live script is created, specify a.mlx extension. If an extension is not specified, MATLAB ® defaults to a file with.m extension, which only supports plain code.
Open Existing Script as Live Script If you have an existing script, you can open it as a live script in the Live Editor. Opening a script as a live script creates a copy of the file and leaves the original file untouched. MATLAB converts publishing markup from the original script to formatted content in the new live script.
To open an existing script (.m) as a live script (.mlx) from the Editor, right-click the document tab, and select Open scriptName as Live Script from the context menu. Alternatively, go to the Editor tab, click Save, and select Save As. Then, set the Save as type: to MATLAB Live Code Files (.mlx) and click Save. MATLAB also autocompletes comments, character vectors, and strings when split across two lines. To escape out of an autocompletion, press Ctrl+ Z or the Undo button.
Autocompletions are enabled by default. To disable them, see. When adding or editing code, you can select and edit a rectangular area of code (also knows as column selection or block edit). This is useful if you want to copy or delete several columns of data (as opposed to rows), or if you want to edit multiple lines at one time. To select a rectangular area, press the Alt key while making a selection. For example, select the second column of data in A. Run Code To run the code, click the vertical striped bar to the left of the code.
Scripts are the simplest type of program, since they store commands exactly as you would type them at the command line. However, functions are more flexible and more easily extensible. Create a script in a file named triarea.m that computes the area of a triangle.
Alternatively, go to the Live Editor tab and click Run. While your program is running, a status indicator appears at the top left of the Editor window. A gray blinking bar to the left of a line of code indicates the line that MATLAB is evaluating. To navigate to the line MATLAB is evaluating, click the status indicator. If an error occurs while MATLAB is running your program, the status indicator becomes an error icon. To navigate to the error, click the icon.
An error icon to the right of the line of code indicates the error. The corresponding error message is displayed as an output.
You do not need to save your live script to run it. When you do save your live script, MATLAB automatically saves it with a.mlx extension. For example, go the Live Editor tab, click Save, and enter the name plotRand. MATLAB saves the live script as plotRand.mlx. Display Output By default, MATLAB displays output to the right of the code. Each output is displayed with the line that creates it, like in the Command Window.
You can change the size of the output display panel by dragging left or right on the resizer bar between the code and output. To clear all output, right-click anywhere in the script and select Clear All Output. Alternatively, go to the View tab and in the Output section, click the Clear all Output button. When scrolling, MATLAB aligns the output to the code that generates it. To disable the alignment of output to code, right-click the output section and select Disable Synchronous Scrolling.
![Pcb Logo Creator Script Files Matlab Pcb Logo Creator Script Files Matlab](http://hi.csdn.net/attachment/201004/2/5293112_1270210747PbPq.gif)
To move the output in line with the code, click the icon to the right of the live script. You also can go to the View tab and in the Layout section, click the Output Inline button. To modify figures in the output, use the tools in the upper-right corner of the figure axes or in the Figure toolstrip.
You can use the tools to explore the data in a figure and add formatting and annotations. For more information, see. To open individual outputs, such as variables and figures, in a separate window, click the icon in the upper right corner of the output. Variables open in the Variables editor, and figures open in a new figure window. Changes made to variables or figures outside of a live script do not apply to the output displayed in the live script. Format Text You can add formatted text, hyperlinks, images, and equations to your live scripts to create a presentable document to share with others. For example, add a title and some introductory text to plotRand.mlx.