MATLAB: Running older versions of Matlab codes (Version 4.2c) on new versions of Matlab & Simulink

new version of matlabold codes

I have some older Matlab & SIMULINK codes that worked fine on older versions of Matlab (Matlab 4.2c and SIMULINK 1.0). They do not work on my new version (Matlab 2012b). Is there are any program that could automatically transfer older version of the files to newer versions, or I have to rewrite these codes from the beginning?

Best Answer

No, there's no program to automatically make the modifications to make MATLAB programs written for a twenty year old release run in a three year old release. However, rather than throwing the code away and starting anew, I advise you to try option 3: try to convert the code yourself.
In his The Origins of MATLAB article, Cleve posted a very short program that ran with the original Fortran version of MATLAB. He said that if he made one change, it ran with the current MATLAB at the time he wrote that article. It still runs today if you make that same one change. As long as you used documented functionality, a lot of the code should just plain work and hopefully much of the rest should require minor changes just like Cleve's example. If you get stuck on a piece of code that doesn't work and that you can't figure out how to modify/update from the context and the comments (the code is well commented, isn't it?) post a question about that small section of code here and/or ask Technical Support for help.
I'm not as sure about how easy it will be to convert the Simulink models because I don't use Simulink very frequently. According to the Release Notes there is a tool called Upgrade Advisor that was introduced in release R2012b. I've never used it so I don't know if it can convert version 1.0 models but I think it would be worth a try.
Related Question