Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
osp_Toolbox_Check would indiscriminately attempt to enable every addon available on the system, incurring substantial delay in certain cases. This patch selectively enables only the necessary ones.
On a test system (Linux, Matlab 2023b, >100 addons available) the osp_Toolbox_Check added about 10 seconds of startup time to every module which called it. This was mostly due to the loop at the top which blindly calls matlab.addons.enableAddon for every available addon (including un-needed addons, already enabled addons, and perhaps addons which have been deliberately disabled for a reason), every time the toolbox check is initiated.
Even so, it was unlikely to actually succeed in enabling the required addons on older releases, since enableAddon operates on the addon identifier rather than name (newer releases can accept either, perhaps unless there are multiple versions)
This patch:
Tested R2023b and R2019a.