View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

1.0 | 1 rating Rate this file 2 Downloads (last 30 days) File Size: 1.87 KB File ID: #42403 Version: 1.1



Daniel (view profile)


27 Jun 2013 (Updated )

Recurses through directories, finding Matlab code and replacing LHS tildes with 'ans'.

| Watch this File

File Information

Recurses through directories, finding Matlab code and replacing LHS tildes with 'ans' to make code backwards compatible.

WARNING: this overwrites files!!! Copy the whole folder before use!!!

Please report bugs on the Matlab FX.
And if you can come up with a better regex let me know.

Required Products MATLAB
MATLAB release MATLAB 8.0 (R2012b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
28 Jun 2013 Jos (10584)

Jos (10584) (view profile)

I am currently rating this as one star because it should not overwrite files by default! This is potentially very dangerous.

You should copy the directory, and make the changes in the copied files. If this is implemented, I will reconsider my rating. The idea is fine btw ...

28 Jun 2013 Jan Simon

Jan Simon (view profile)

I recommend not to overwrite the automatically accessed "ans" variable. This can be confusing e.g. during debugging. I'd use something like "dummy" instead.

The function is useful to support Matlab versions <= 2009a. The help text does niot have a H1-line, but is clear and contains the required warning. Perhaps a dialog might be added to ask for a confirmation. I cannot test the robustness of the REGEXP currently, such that I do not dare to rate this submission yet.

Btw. the need to include a subfunction to obtain a recursive list of files in subfolders is shows, that TMW should urgently include this as a toolbox function. This is a standard task which should not be left to the users.

Comment only
01 Jul 2013 1.1

Added warning dialogue at top of function. And explicitly declared DUMMY_VAR_NAME for user to change at his/her discretion.

Contact us