Desktop Tools and Development Environment Previous page   Next Page

Cut, Copy, Paste, and Move

You can cut and copy a selection from a desktop tool to the clipboard and then paste it from the clipboard into another tool or application. Use the Edit menu, toolbar, context menus, or standard keyboard shortcuts. For example, you can copy a selection of statements from the Command History window and paste them into some MATLAB desktop tools.

Use Paste to move items copied to the clipboard from other applications. The Paste Special item in the Edit menu opens the selection on the clipboard in the Import Wizard. You can use this to copy data from another application, such as Excel, into MATLAB. For details, see the Import Wizard documentation.

When editing in the Command Window and Editor/Debugger, to move text to a new location, select the text and drag it. To copy text, press Ctrl and drag the selected text to the new location.

To undo the most recent cut, copy, or paste command, select Undo from the Edit menu. Use Redo to reverse the Undo. For some tools, you can undo multiple times in succession.

See also the clipboard function.

Drag and Drop

You can also move or copy a selection from one tool to another by dragging the selection. For example, make a selection in the Command History window and drag it to the Command Window, which pastes it there. Edit the lines in the Command Window, if needed, and then press the Enter key to run the lines from the Command Window.

Another example is to drag a filename from the Current Directory browser to the Editor/Debugger to open that file in the Editor/Debugger. If you drag editable text, for example, text in the Editor/Debugger, the text is cut rather than copied. Use Ctrl and drag to copy rather than cut editable text.

On Windows platforms, you can drag items from external applications into MATLAB. For example, dragging text from a Microsoft Word document into the Editor/Debugger cuts and pastes it into the open file. Dragging an M-file from Windows Explorer to the Command Window runs the file. Similarly, you can drag selections from desktop tools to other applications. For example, you can drag text from the Editor/Debugger to Microsoft Word.


Previous page  Selecting Multiple Items Printing and Page Setup Options for Desktop Tools Next page

© 1994-2005 The MathWorks, Inc.