How to close neural network training dialog in 2022a

8 views (last 30 days)
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.

Accepted Answer

Abhijit Bhattacharjee
Abhijit Bhattacharjee on 19 May 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 Comments
Sven Merk
Sven Merk on 19 May 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 on 19 May 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

Sign in to comment.

More Answers (0)

Categories

Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!