Matlab script compatibility issue
12 views (last 30 days)
Show older comments
We have a Matlab script written for Matlab 2010. The script is not supported by newer Matlab versions. We need the script run with newer Matlab versions. The script has also gui interface which is compatible with newer versions. I understand that it is not possible to compile the gui. Is it possible to compile the non gui script with Matlab 2010 (Windows 7) copy it to the relevant computers and then call the compiled code functions by the gui Matlab script? If so, will the compiled script run on Windows 7 through Windows 10 platforms without need to recompile it? Are there other solutions to that script compatibility problem?
4 Comments
Walter Roberson
on 7 Feb 2017
In order to be able to compile into DLL that are callable from MATLAB, you need MATLAB Compiler SDK -- though back in the R2010* time frame it was probably the case that MATLAB Compiler itself would have been the proper tool (they moved some functionality after R2010*). I suspect, though, that you would run into the same problem I mentioned, that there is a calling incompatibility at the R2012a boundary. If so then.... "You would need to compile to a stand-alone program that was communicated with, some-how (perhaps Active-X, perhaps TCP)"
Having a computation engine that has no graphics and is called as needed can be a quite useful technique for version-proofing at the MATLAB level, as long as MATLAB continues to support that communications mechanism. It does, though, have the challenge of internal software version changes. For example if you discover a weakness in a computation routine that would most naturally be solved by adding different computations with different commands, then you still have to retain and bug-fix the old commands because somewhere there just might be someone holding on to an older version of the GUI interface.
Answers (1)
Walter Roberson
on 7 Feb 2017
"Is it possible to compile the non gui script with Matlab 2010 (Windows 7) copy it to the relevant computers and then call the compiled code functions by the gui Matlab script?"
Not directly. R2012a was the break-point at which pre-R201a compiled mex code stopped being callable from R2012a+ or later versions. You would need to compile to a stand-alone program that was communicated with, some-how (perhaps Active-X, perhaps TCP).
If you have MATLAB Coder and it happened to support everything you needed then you could generate C/C++ code and compile it to work with any later version.
Which features are you running into compatibility problems with?
0 Comments
See Also
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!