How to close neural network training dialog in 2022a

10 vues (au cours des 30 derniers jours)
Sven Merk
Sven Merk le 16 Mai 2022
Commenté : Sven Merk le 19 Mai 2022
Hello everyone,
in 2022a the nntraintool command has been removed
Citation:
R2022a: nntraintool has been removed
Errors starting in R2022a
nntraintool has been removed. To train a network and open the training window, use train instead.
The documentation only mentions that opening it is now done via the "train" command. It does however not mention how to replace
nntraintool('close')
in 2022a.
Can anyone point me to some code on how to programmatically close the traintool after training? Or is this function simply lost?
Thanks in advance.

Réponse acceptée

Abhijit Bhattacharjee
Abhijit Bhattacharjee le 19 Mai 2022
Referring to this question, this can be done using the following command:
delete(findall(0))
This is because the ‘HandleVisibility’ is set to ‘off’ for these plots by default.
  2 commentaires
Sven Merk
Sven Merk le 19 Mai 2022
Thank you for the response.
Yes, this approach indeed helps in 2022a.
Unfortunately I need to maintain compatibility with 2020b for at least some months as not all my colleagues can upgrade right now. Now I find myself in the dilemma that either solution works only in one of those releases. I can of course try to add some switch statement checking for the matlab release and remove it in the future; But this appears to me not a very clean solution.
If there is no better (more window-selective or version-compatible) solution I will gladly accept your answer, because it is indeed helping, but I will give others some more days in the hope my additional requirements that I did not mention in the beginning could also be fulfilled.
Sven Merk
Sven Merk le 19 Mai 2022
This is what I came up with, thanks to your answer:
function close_traintool()
matlab_version = regexp(version("-release"), "(\d{4,4})(a|b)", "tokens", "once");
if str2double(matlab_version{1}) >= 2022
delete(findall(0));
else
nntraintool('close');
end
end

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Image Data Workflows dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by