Desktop Tools and Development Environment Previous page   Next Page

Checking Files Out of the Source Control System

Check out files using the Current Directory browser for one or more files. For only one file, you can also use the Editor/Debugger, Simulink, or Stateflow.

Checking Out Files Using the Current Directory Browser

  1. In the Current Directory browser, select the files to check out.
  2. Right-click, and from the context menu, select Source Control -> Check Out. The Check out file(s) dialog box opens.

    Image of Check out of source control dialog box.

  3. Complete the dialog box:
    1. To check out the versions that were most recently checked in, select the Latest version option.
    2. To check out a specific version of the files, select the Version number option and type the version number in the field.
    3. To prevent others from checking out the files while you have them checked out, select Lock latest version. To check out read-only versions of the file, clear Lock latest version.
  4. Click OK.

An error appears in the Command Window if the file is already checked out.

After checking out files, make changes to them in MATLAB or another product, and save the files. For example, edit an M-file in the Editor/Debugger.

If you try to change a file without first having checked it out, the file is read-only, as seen in the title bar, and you will not be able to save any changes. This protects you from accidentally overwriting the source control version of the file.

If you end the MATLAB session, the file remains checked out. You can check in the file from within MATLAB during a later session, or directly from your source control system.

Checking Out a File Using the Editor/Debugger, Simulink, or Stateflow

  1. Open the M-file, Simulink model, or Stateflow chart you want to check out. The title bar indicates the file is read-only.
  2. Select File -> Source Control -> Check Out. The Check out file(s) dialog box opens.
  3. Complete the dialog box as described in step 3 of Checking Out Files Using the Current Directory Browser, and click OK.

Function Alternative

Use checkout to check out a file from the source control system. You can check out multiple files at once and specify checkout options. The checkout function takes this form:

checkout({'file1','file2', ...},'option','value')

For filen, use the complete path and include the file extension.

Use the option argument to

The options apply to all files being checked out. The files can be open or closed when you use checkout.

Example Using checkout Function--Check Out a Specific Version of a File.   To check out the 1.1 version of the file clock.m, type

checkout('\myserver\mymfiles\clock.m','revision','1.1')

For other examples, see the reference page for checkout.


Previous page  Checking Files Into the Source Control System Undoing the Checkout Next page

© 1994-2005 The MathWorks, Inc.