【发布时间】:2015-03-08 12:23:10
【问题描述】:
我正在编写一个程序,但我走到了死胡同。
程序开始询问:
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 语句以执行训练位?
【问题讨论】:
-
你知道while循环吗?
-
是的..但我从未使用过它
-
如果用户选择训练,那么它将使用 ANN 训练数据,然后保存数据。我只想问用户他是否想重新训练或进入下一步。如果他想重新训练它,那么程序将与火车相同,但结果不同
标签: matlab if-statement