Editing and Debugging M-Files


MATLAB® software provides powerful tools for creating, editing, and debugging files, as detailed here. For information about the MATLAB language and writing M-files, see the Programming Fundamentals documentation.

Begin with Existing CodeUse code resources such as your Command Window and History, and existing M-files, demos, and examples.
Ways to Edit, Evaluate, and Debug M-FilesUse the MATLAB® Editor for M-files or any text file. Or use another editor you have, along with debugging functions in the Command Window.
Starting, Customizing, and Closing the EditorCreate and open files, arrange document windows, and set preferences.
Entering Statements in the EditorChanging case, undo and redo, comments, tab completion. Also use features common to the Command Window for entering statements.
Appearance of an M-File — Making Files More ReadableSyntax highlighting, indenting, line and column numbers, highlighting, and more.
Navigating in an M-FileGo to a line number, function, bookmark, back and forward, and open a selection.
Finding Text in FilesFind and replace text in the current file or multiple files. Incremental search tool.
Comparing Files and DirectoriesView differences between two files or two directories.
Keyboard Shortcuts in the EditorUse the keyboard to navigate in or perform other common actions in a file.
Saving, Printing, and Closing Files in the EditorSave and autosave features, printing and page setup, and closing files.
Running M-Files in the EditorRunning M-files from the Editor, with no input arguments or with input arguments
Finding Errors, Debugging, and Correcting M-FilesAutomatically analyze code using M-Lint to find errors and make improvements, and use debugging features to isolate run-time problems.
M-Lint Code AnalyzerCheck your code for problems and get recommendations to maximize performance and maintainability.
Debugging Process and FeaturesGraphical debugging tools and functions for debugging in the Command Window.
Using Cells for Rapid Code Iteration and Publishing ResultsDefine sections of your M-files as cells. Use cells for publishing M-files to formats like HTML. Also use cells to experiment and incrementally modify values in M-files.
  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS