How to get the visdiff output ?

조회 수: 7 (최근 30일)
Maha
Maha 2019년 6월 17일
편집: Raghvendra Kumar 2020년 7월 7일
Hello,
After using a visdiff(file1,file2,'txt') expression, it opens a window with the differencies between the two files, which is exactly what I'm looking for.
But how do you use it as an output ?
At the end, there is :
Number of matching lines: XXX
Number of unmatched lines in left file: XXX
Number of unmatched lines in right file: XXX
How do I get each of them (not the number but the output)
Cheers

답변 (1개)

Raghvendra Kumar
Raghvendra Kumar 2020년 7월 7일
편집: Raghvendra Kumar 2020년 7월 7일

Hi Maha, this might help you

comparison = visdiff('test.m', 'test2.m');

fp = fopen('diff.txt', 'w');

fprintf(fp, '%s', comparison);

fclose(fp);

the diff.txt file will contain the output

카테고리

Help CenterFile Exchange에서 General PDEs에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by