我正在编写一个程序,但我走到了死胡同。
程序开始询问:
button = questdlg('Would you like to train or test the network?', ...
'Artificial Neural Network', 'Train', 'Test', 'Exit', 'Exit');
if strcmp(button,'Train') ...
elseif strcmp(button,'Test') ...
elseif strcmp(button,'Exit') ...
但我也想问
button = questdlg('Would you like to train or test the network?', ...
'Artificial Neural Network', 'Train', 'Test', 'Exit', 'Exit');
if strcmp(button,'Train') ... %do that thing
%but if the user wants to retrain in again I want to ask again
A = questdlg('Would you like to retrain or test the network?', ...
'Artificial Neural Network', 'Retrain', 'Test', 'Exit', 'Exit');
if strcmp (A, 'Retrain') do the first step as it is chosen the Train bit
elseif strcmp(button,'Test') ...
elseif strcmp(button,'Exit') ...
end
那么,如果用户选择重新训练,我如何重定向我的 if 语句以执行训练位?