필터 지우기
필터 지우기

Using MATLAB comparison as an external diff tool

조회 수: 23 (최근 30일)
Omid
Omid 2014년 5월 7일
답변: Rebecca Nakhoul 2020년 5월 12일
I am using Git and SourceTree for source control. How can I use MATLAB comparison tool as an external diff tool there? How should I change the .gitconfig or set the required command in SourceTree diff option?

답변 (3개)

Steven Lord
Steven Lord 2017년 1월 4일
As of release R2016b you can use the instruction on this page in the documentation to configure an external source control tool to use the MATLAB Comparison Tool to diff and merge code.
  댓글 수: 5
David Barry
David Barry 2018년 9월 18일
@TS I am having the exact same problem as you but swapping to %LOCAL %REMOTE doesn't seem to solve it for me. I have attached a screenshot showing my config options from SourceTree. Can you please just confirm this is exactly what you entered to fix the issue?
Regards David
David Barry
David Barry 2018년 9월 18일
In case anybody else is having this issue, the solution is to set the arguments to $LOCAL $PWD/$REMOTE

댓글을 달려면 로그인하십시오.


Jan
Jan 2017년 1월 4일
You can call the built-in comparison tool, buit it is not documented and will be subject to changes. What is the desired output?
In Matlab R2016b:
file1 = which('plot.m')
file2 = which('diff.m')
html = comparisons_private('textdiff', file1, file2);
web(['text://', html])
Look into the source of comparisons_private.m to see more options.
You can find out these methods by starting the profiler and select the "Compare" menu in the editor. Afterwards profile report tells you, which functions are called. As far as I can see, this is not a reverse engineering of Matlab and therefore it is legal.

Rebecca Nakhoul
Rebecca Nakhoul 2020년 5월 12일
To customize source control tools to use MATLAB for Diff and Merge, follow the steps described in the MATLAB documentation.
It covers source control tools such as SourceTree Git, Tortoise SVN and Perforce P4V.

카테고리

Help CenterFile Exchange에서 Source Control Integration에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by