Is there any short method for upgradation of m-Script to newer version of MATLAB?
7 次查看(过去 30 天)
显示 更早的评论
Hello, I want to upgrade some MATLAB scripts into latest version of MATLAB (Let say from 2010B to 2014B). Is there any method to do this automatically? As we know with every release there will be some instruction set modification.
6 个评论
Guillaume
2017-3-17
Well as I said, the most breaking upgrade is actually to R2014b due to the major changes to HG2 in that version. While there has been some breaking changes in versions from 2014b to 2017a, it's less likely to impact the OP.
I'd be less scared of the jump from 2014b to 2017a than the jump to 2014b
采纳的回答
John D'Errico
2017-3-17
Nope. There is no automatic, magical way to ensure that some random old script is fully compatible. In general, they make every attempt to ensure compatibility. But sometimes they need to prune things away.
So I'd suggest you open the file in the editor. Look for any red mlint flags. (I.e., red horizontal lines on the right.) Fix them, one at a time.
Next, try to use the code as intended. Resolve any problems, one at a time. It won't take too long.
0 个评论
更多回答(1 个)
Jan
2017-3-17
2014b uses HG2 in opposite to 2010b's HG1. If the code assumes, that graphic handles are double values, it will fail. uitree has a different calling style and the resize behavior of figures have changed during they are opened. dataread was removed in 2016b already, and the change of strncmp(a,b,0) happend before 2016b also.
There are many pitfalls between Matlab versions. Most of them are tiny, but can affect your work. I did some tests for compatibility on larger codes (some 100'000 lines of code). Here only exhaustive unit-tests could reveal the problems: Each subfunction is called with a representative set of allowed inputs and teh results are compared with the expectations. In addition some invalid inputs are provided and the regular reaction is checked. Afterwards some integration tests checked the output of the whole program suite.
Writing unit-tests for each and every tiny or dumb function seems to be very tedious. Without such tests a migrating large codes cannot be performed reliably.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!