Compare files with MATLAB

后端 未结 5 1430
时光取名叫无心
时光取名叫无心 2021-01-22 06:36

I would like to know how could I compare two files (line by line) (*.xml, .m,.txt,...etc) using MATLAB.

file1 = \'toto.xml\';
file2 = \'titi.xml\';
         


        
5条回答
  •  囚心锁ツ
    2021-01-22 07:39

    first change the text file to string, then use strcmp function of matlab.

    text1 = fileread('test.txt');
    text2 = fileread('testcp.txt');
    strcmp(text1, text2)
    

提交回复
热议问题