我正在编写一个程序,我需要一些帮助。它从问这个问题开始:
A = questdlg('What would you like to do?','Artificial Neural Network',...
'Train','Test','Exit','Exit');
然后根据用户的选择,它会提出某些问题并做某些事情
`if strcmp(A,'Train')
B = questdlg ('Would you like to create a new network or add to the already trained data?',...
'!','Create','Add','Exit','Exit');
if strcmp (B, 'Create')
if strcmp (B, 'Create')
%add as many text file as he wants to - need to figure out how I
%can extract the data from them though
[fname,dirpath]=uigetfile ('*.txt','Select a txt file','MultiSelect',...
'on');
elseif strcmp(B,'Add')
%choose what type is it
D = listdlg('PromptString','What colour is it?',...
'SelectionMode','single', 'ListString',...
{'Strawberry','Orange',...
'Chocolate','Banana','Rose'}, 'Name','Select Ice Cream',...
'ListSize',[230 130]);
%and then whatever choise he chooses it will feed it to the main
%function. For example if he chooses Orange then it will go the
%second part of the training, if it chooses Rose and the fifth
%one and so on.
else strcmp(B,'Exit')
disp('Exit')
end
所以我需要帮助的是:
- 用户在 Matlab 中导入 txt 文件时如何使用它们来运行程序?和
- 用户如何在 中添加更多选项,
listdlg
何时选择选项然后自动转到代码的相应步骤?
任何帮助,将不胜感激!
谢谢!!:)
PS:抱歉发了这么长的帖子!