MATLAB Community

MATLAB, community & more

File and Folder Comparison Tool Update in R2008a

I’d like to welcome guest blogger Malcolm Wood from the Simulink Model Management team. Malcolm will occasionally be blogging here on the Inside the MATLAB Desktop blog.

For many years the MATLAB Desktop has included a simple tool for comparing text files. You may have used it from the MATLAB Editor to see the changes you have made to your M-file since you last saved it, or you may have used it from the Directory Browser to compare two files on disk.

In R2008a we extended the capabilities of this tool to compare files which aren’t just plain text. You can now use it to compare the variables in MAT-files. It will tell you the names of the variables which are in each file, and for the variables which appear in both files it will tell you whether their values are the same or not:

And if you want to see exactly what’s different about these two variables called “X”, then clicking on either one will open it in the Variable Editor so that you can take a closer look.

For other types of binary file, the MATLAB will scan the two files and simply tell you whether their contents are the same or not.

You might have noticed from the screenshot above that the title is “File and Directory Comparisons”, namely because another new feature is the ability to compare entire directories. We think this sort of thing is useful for cases where you’ve taken a copy of some files and made some changes to get them to work for you. By comparing the two directories you can quickly review all the changes you made without leaving MATLAB.

This tool is available from the Directory Browser: just right-click on a directory and choose “Compare Against…”.

If the two directories you compare contain files of the same name, MATLAB will scan those files to determine whether their contents are the same or not. If they’re not, you’ll see a hyperlink to compare the files in detail.

If there are sub-directories with the same name but different time-stamps, there will be a hyperlink to let you compare the contents of those too.

We hope you’ll find these new features useful. And if there are changes you think we should make, leave us a comment to let us know!

-by Malcolm Wood, The MathWorks

  • print


To leave a comment, please click here to sign in to your MathWorks Account or create a new one.