Running/testing scripts on multiple Matlab/Simulink versions?
Afficher commentaires plus anciens
I do a lot of script and tool development for Matlab/Simulink. This involves supporting multiple versions of Matlab, usually from R2016a+ (previously it was R2011b+). This means that I have almost a dozen different versions of Matlab installed on my computer. When one of my tools/scripts encounters a bug in a version of Matlab, or the Matlab/Simulink behaviour differs between versions, I need to be able to pinpoint which version the bug occurred in or the behaviour changed in. I usually can't find the bugs listed on the Bug Reports support page, especially when the bugs are already fixed in later versions. Likewise, when the behaviour changes I check if it is noted in the Release Notes, but these are very high-level descriptions and I usually can't find it mentioned.
Given that the aforementioned pages are not reliable, I usually need to figure out which version of Matlab has the bug fix or behaviour change. I typically follow this process:
- I create a script to replicate the bug automatically (if possible).
- One by one I open each version of Matlab, execute the script, and make note of when the bug occurs. Sometimes I have to download and install additional Matlab versions.
- Then I develop a workaround for the bug or behaviour change by having the script check which version it is running on, and then perform extra steps to fix the buggy behavior or accommodate for inconsistent behaviours between the versions.
My questions is: Is it possible run a script on multiple versions of Matlab in order to make this process a little easier?
Réponse acceptée
Plus de réponses (1)
I searched for this question years ago, and recently, I found my own solution, which I’m quite satisfied with. Here’s what I did:
- I created a function test class to test all my functions. It saves test result files and records pass/fail statuses along with result file links in an Excel sheet.
- I wrote a Python function to open different versions of MATLAB and run tests sequentially.
- I created a VBS file to execute the Python function.
Now, all I need to do is:
- Double-click the VBS file.
- Enter the function name in the popup dialog, and the tests will run automatically in all MATLAB versions.
- Check my Excel sheet for test results.
1 commentaire
Steven Lord
le 30 Jan 2025
This may be overkill for your use case, but you might be interested in the Continuous Integration (CI) functionality documented on this page.
Catégories
En savoir plus sur Structures dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!