MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

Customize External Source Control to Use MATLAB for


Diff and Merge


You can customize external source control tools to use the MATLAB Comparison Tool for
diff and merge. If you want to compare MATLAB files such as live scripts, MAT, SLX, or
MDL files from your source control tool, then you can configure your source control tool
to open the MATLAB Comparison Tool.

MATLAB Comparison Tool provides useful merge tools for MathWorks files and is
compatible with all popular software configuration management and version control
systems.

Set up your source control tool to use MATLAB as the application for diff and merge for
the file extensions you want, for example, .mlx, .mat, .slx, or .mdl, by following these
steps:

(^1) To get the required file paths and set the preference to reuse open MATLAB sessions,
run this command in MATLAB:
comparisons.ExternalSCMLink.setup()
This command sets the MATLAB preference, under Comparison, called Allow
external source control tools to use open MATLAB sessions for diffs and
merges.
The command also displays the file paths you will copy and paste into your source
control tool setup:



  • On Windows:


matlabroot\bin\win64\mlDiff.exe

matlabroot\bin\win64\mlMerge.exe


  • On Linux:


matlabroot/bin/glnxa64/mlDiff

matlabroot/bin/glnxa64/mlMerge

On Mac:

matlabroot/bin/maci64/mlDiff

32 Source Control Interface

Free download pdf