Variable Editor
Double-click a variable in the Workspace browser, or use open var Variable name, to see it in the Variable Editor. Fig 5
Use the Variable Editor to view and edit a visual representation of variables in the workspace.
Fig.5 Variable Editor
Editor
Editing M-Files
Fig.6 Set Path dialog box
You can use any text editor to create M-files, such as Emacs. Use Editor/Debugger preferences (accessible from the desktop by selecting File > Preferences > Editor/Debugger) to specify that editor as the default. If you use another editor, you can still use the MATLAB Editor for debugging, or you can use debugging functions, such as dbstop, which sets a breakpoint.
If you just need to view the contents of an M-file, you can display the contents in the Command Window using the type function.
Use the M-Lint automatic code analyzer to help you identify problems and potential improvements in your code. For details, see “Improving and Tuning M-Files” on page 7-25.
You can evaluate your code in sections, called cells, and can publish your code, including results, to popular output formats like HTML. For more information, see “Using Cells for Rapid Code Iteration and Publishing Results” in the MATLAB Desktop Tools and Development Environment documentation.
For More Information See “Editing and Debugging M-Files” in the MATLAB Desktop Tools and Development Environment documentation, and the function reference pages for edit, type, and debug.
Publishing M-Files
Fig.7 Publishing M-Files
After adding text markup, click the Publish button on the Editor toolbar. By default, MATLAB software generates formatted HTML output and presents the document in the MATLAB Web Browser.
You can publish M-Files to HTML, XML, and LaTeX. If your system is a personal computer (PC), you also can publish M-Files to Microsoft Word and PowerPoint®.
For More Information See “Publishing M-Files” in the MATLAB Desktop Tools and Development Environment documentation, and the function reference pages for publish.
Improving and Tuning M-Files
Finding Errors Using the M-Lint Code Report
The M-Lint Code Check Report displays potential errors and problems, as well as opportunities for improvement in your M-files. The term lint is used by similar tools in other programming languages such as C.
Access the M-Lint Code Check Report and other reports from the Current Directory browser. You run a report for all files in the current directory
The M-Lint Code Check Report displays a message for each line of an M-file it determines might be improved. For example, a common M-Lint message is that a variable is defined but never used in the M-file.
To open the M-file in the Editor at the line indicated, click the line number.
Fig.8 M-Lint Code report
For More Information See “Tuning and Managing M-Files” and “M-Lint Code Analyzer” in the MATLAB Desktop Tools and Development Environment documentation, and the reference page for the mlint function.