How to close neural network training dialog in 2022a

7 次查看(过去 30 天)
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.

采纳的回答

Abhijit Bhattacharjee
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 个评论
Sven Merk
Sven Merk 2022-5-19
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 2022-5-19
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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by