Compatibility of code when updating Matlab licence
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello everyone,
I am working on a project requiring to use at least Matlab R2016, however all the code I wrote before is designed for Matlab R2014b... As I have not found a tool to check incompatibilities - the one available on Matlab platfrom starts with R2017 version-, I was wondering if someone could help me make sur that updating my licence won't make me start over all the work I've already done.
Thanks for the help!
Morgane
PS: as the computer uses Windows7, would you know what is the latest version I can actually use?
0 Commenti
Risposte (1)
Jan
il 24 Giu 2022
R2021b supports Windows 7 SP1, while Win7 is not supported in R2022a anymore.
There is no tool for an exhaustive check of incompatibilities. The greates difference is the new Graphics System "HG2", but this was part of R2014b already. So actually you can expect your code to be running.
The only trustworthy method is to check this exhaustively by UnitTesting. This requires a complete set of valid and invalid inputs for all functions you use. If you did not include such tests from the beginning, adding them afterwards is very time-consuming.
I'm using a large project with about 300'000 lines of Matlab code and 65'000 lines for the unit-testing. These tests revealed many incompatibilities between the Matlab versions, e.g. strncmp with empty arguments or n=0. It took many hours to check each occurrence of strncmp, if it depends on such input.
2 Commenti
Steven Lord
il 24 Giu 2022
You don't need to install the unit testing framework. It's part of MATLAB.
The matlab.unittest.TestCase class has been part of MATLAB since release R2013a if you want to create class-based tests. But if you're not familiar with classes you can still create function-based tests (functiontests was introduced in release R2013b) or script-based tests (assert was introduced in release R2007a, runtests in release R2013b.)
This documentation page describes the functionality provided by each type of tests. Function- and class-based tests can do everything script-based tests can do and more, and class-based tests provide additional functionality beyond what's available in function-based tests. Which type of tests you write depends on your level of comfort with writing scripts, functions, or classes in MATLAB and what functionality you need to efficiently test your code.
Vedere anche
Categorie
Scopri di più su Write Unit Tests in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!