function nnmodref(cmd,arg1,arg2,arg3)
%NNMODREF Neural Network Model Reference Controller GUI for Neural Network Controller Toolbox.
%
% Synopsis
%
% nnmodref(cmd,arg1,arg2,arg3)
%
% Warning!!
%
% This function may be altered or removed in future
% releases of the Neural Network Toolbox. We recommend
% you do not write code which calls this function.
% This function is generally being called from a Simulink block.
% Orlando De Jesus, Martin Hagan, 1-25-00
% Copyright 1992-2004 The MathWorks, Inc.
% $Revision: 1.7.2.1 $ $Date: 2004/03/24 20:42:49 $
% CONSTANTS
me = 'Model Reference Control';
% DEFAULTS
if nargin == 0, cmd = ''; else cmd = lower(cmd); end
% FIND WINDOW IF IT EXISTS
fig = 0;
% 9/3/99 We alow the program to see hidden handles
fig=findall(0,'type','figure','name',me);
if (size(fig,1)==0), fig=0; end
if length(get(fig,'children')) == 0, fig = 0; end
% GET WINDOW DATA IF IT EXISTS
if fig
H = get(fig,'userdata');
if strcmp(cmd,'')
if get(H.gcbh_ptr,'userdata')~=arg1
delete(fig);
fig=0;
end
else
if strcmp(cmd,'close')
delete(fig)
return;
end
% ODJ 1-13-00 We check if the field SimulationStatus exist before reading that field
if isfield(get(H.gcbh_ptr,'userdata'))
if isfield(get_param(get_param(get(H.gcbh_ptr,'userdata'),'parent'),'objectparameters'),'SimulationStatus')
SimulationStatus=get_param(get_param(get(H.gcbh_ptr,'userdata'),'parent'),'simulationstatus');
else
SimulationStatus='none';
end
else
SimulationStatus='none';
end
if (strcmp(SimulationStatus,'running') | strcmp(SimulationStatus,'paused')) & ~strcmp(cmd,'close')
set(H.error_messages,'string','You must stop the simulation to change NN configuration parameters.');
return;
end
end
end
%==================================================================
% Activate the window.
%
% ME() or ME('')
%==================================================================
if strcmp(cmd,'')
if fig
figure(fig)
if strcmp(arg3,'nnident')
set(H.error_messages,'string',sprintf('Generate or import data before training the neural network controller.'));
else
set(H.error_messages,'string',sprintf('Perform plant identification before controller training.'));
end
set(fig,'visible','on')
else
nncontrolutil('nnmodref','init',arg1,arg2,arg3)
end
%==================================================================
% Close the window.
%
% ME() or ME('')
%==================================================================
elseif strcmp(cmd,'close') & (fig)
delete(fig)
return;
elseif strcmp(cmd,'stop_sim')
fig2=findall(0,'type','figure','tag','ind_adap_data');
if (size(fig2,1)==0), fig2=0; end
f2=get(fig2,'userdata');
f2.stop=1;
set(fig2,'UserData',f2);
return;
elseif (strcmp(cmd,'apply') | strcmp(cmd,'ok')) & (fig)
arg1=get(H.gcbh_ptr,'userdata');
epochs_c = get(H.epochs_c_ptr,'userdata');
set_param(arg1,'epochs_c',num2str(epochs_c));
retraining_c = get(H.retraining_c_ptr,'userdata');
set_param(arg1,'retraining_c',num2str(retraining_c));
max_r = get(H.max_r_ptr,'userdata');
set_param(arg1,'max_r',num2str(max_r));
min_r = get(H.min_r_ptr,'userdata');
set_param(arg1,'min_r',num2str(min_r));
max_r_int = get(H.max_r_int_ptr,'userdata');
set_param(arg1,'max_r_int',num2str(max_r_int));
min_r_int = get(H.min_r_int_ptr,'userdata');
set_param(arg1,'min_r_int',num2str(min_r_int));
sam_training_c = get(H.sam_training_c_ptr,'userdata');
set_param(arg1,'sam_training_c',num2str(sam_training_c));
S1c = get(H.S1c_ptr,'userdata');
set_param(arg1,'S1c',num2str(S1c));
Ref_file = get(H.Ref_file_ptr,'userdata');
set_param(arg1,'Ref_file',Ref_file);
Nrc = get(H.Nrc_ptr,'userdata');
set_param(arg1,'Nrc',num2str(Nrc));
Nic = get(H.Nic_ptr,'userdata');
set_param(arg1,'Nic',num2str(Nic));
Njc = get(H.Njc_ptr,'userdata');
set_param(arg1,'Njc',num2str(Njc));
Use_Inc_training = get(H.Use_Inc_training_ptr,'userdata');
set_param(arg1,'Use_Inc_training',num2str(Use_Inc_training));
Use_Previous_Weights = get(H.Use_Previous_Weights_ptr,'userdata');
set_param(arg1,'Use_Previous_Weights',num2str(Use_Previous_Weights));
IW_r = get(H.IW_r_ptr,'userdata');
IW_u = get(H.IW_u_ptr,'userdata');
IW_y = get(H.IW_y_ptr,'userdata');
LW_c = get(H.LW_c_ptr,'userdata');
B1_c = get(H.B1_c_ptr,'userdata');
B2_c = get(H.B2_c_ptr,'userdata');
set_param(arg1,'IW_y',mat2str(IW_y,20));
set_param(arg1,'IW_u',mat2str(IW_u,20));
set_param(arg1,'IW_r',mat2str(IW_r,20));
set_param(arg1,'LW_c',mat2str(LW_c,20));
set_param(arg1,'B1_c',mat2str(B1_c,20));
set_param(arg1,'B2_c',mat2str(B2_c,20));
if strcmp(cmd,'ok')
delete(fig)
end
%==================================================================
% Execute Identification Training.
%
% ME('training')
%==================================================================
elseif strcmp(cmd,'training') & (fig)
arg1=get(H.gcbh_ptr,'userdata');
arg2=get(H.gcb_ptr,'userdata');
nnident('',arg1,arg2,'nnmodref');
%==================================================================
% Execute Controller Training.
%
% ME('training')
%==================================================================
elseif (strcmp(cmd,'training_con') | strcmp(cmd,'cont_training_con') | strcmp(cmd,'data_ok') | ...
strcmp(cmd,'gen_data') | strcmp(cmd,'have_file')) & (fig)
if strcmp(cmd,'gen_data') & (fig)
H.Data_Imported=0;
set(fig,'UserData',H);
elseif strcmp(cmd,'have_file') & (fig)
ImportStr=arg1;
H.Data_Imported=1;
if nargin==3
Data_Name=arg2;
else
U_Name=arg2;
Y_Name=arg3;
end
end
set(H.Train_con,'enable','off')
set(H.Cancel_but,'enable','off')
set(H.OK_but,'enable','off')
set(H.Apply_but,'enable','off')
set(H.Handles.Menus.File.Save_NN,'enable','off')
set(H.Handles.Menus.File.Save_Exit_NN,'enable','off')
if (strcmp(cmd,'gen_data') | strcmp(cmd,'have_file'))%strcmp(cmd,'start_training')
arg1=get(H.gcbh_ptr,'userdata');
a1 = str2num(get(H.max_r_edit,'string'));
if length(a1) == 0,
max_r=get_param(arg1,'max_r');
present_error(fig,H,H.max_r_edit,max_r,1, ...
'Please correct the maximum reference value');
return
else max_r=a1; set(H.max_r_ptr,'userdata',a1); end
a1 = str2num(get(H.min_r_edit,'string'));
min_r=get_param(arg1,'min_r');
if length(a1) == 0,
present_error(fig,H,H.min_r_edit,min_r,1, ...
'Please correct the minimum reference value.');
return
elseif a1>=max_r
present_error(fig,H,H.min_r_edit,min_r,1, ...
'Please correct the maximum and minimum reference values.');
return
else min_r=a1; set(H.min_r_ptr,'userdata',a1); end
a1 = str2num(get(H.max_r_int_edit,'string'));
if (length(a1) == 0) | a1<=0,
max_r_int=get_param(arg1,'max_r_int');
present_error(fig,H,H.max_r_int_edit,max_r_int,1, ...
'You must enter a valid number for the maximum interval value over which the random input is constant.');
return
else max_r_int=a1; set(H.max_r_int_ptr,'userdata',a1); end
a1 = str2num(get(H.min_r_int_edit,'string'));
min_r_int=get_param(arg1,'min_r_int');
if (length(a1) == 0) | a1<=0,
present_error(fig,H,H.mi
没有合适的资源?快使用搜索试试~ 我知道了~
神经网络GRNN预测程序源代码
共32个文件
txt:32个
1星 需积分: 48 57 下载量 4 浏览量
2018-12-24
10:21:11
上传
评论 6
收藏 87KB ZIP 举报
温馨提示
径向基神经网络做预测控制程序的代码,代码以txt文件形式上传。
资源推荐
资源详情
资源评论
收起资源包目录
经网络预测控制程序的源代码,神经网络的种类是径向基函数神经网络.zip (32个子文件)
经网络预测控制程序的源代码,神经网络的种类是径向基函数神经网络
calcjjdjj.m.txt 3KB
csrchhyb.m.txt 8KB
nnidenthelp.m.txt 11KB
sfunxy2.m.txt 13KB
dnetinv.m.txt 950B
nnimporthelp.m.txt 3KB
trainbfgc.m.txt 14KB
csrchbac.m.txt 8KB
dyduvar.m.txt 3KB
calcgradxmodref.m.txt 5KB
nndataexporthelp.m.txt 2KB
csrchcha.m.txt 7KB
nnexporthelp.m.txt 4KB
nnpredict.m.txt 19KB
nndataimport.m.txt 9KB
nndataexport.m.txt 7KB
csrchbre.m.txt 7KB
netinv.m.txt 2KB
nnpredicthelp.m.txt 5KB
calcgxmodref.m.txt 3KB
nnmodrefhelp.m.txt 10KB
calcperf2.m.txt 3KB
nnexport.m.txt 20KB
csrchgol.m.txt 5KB
nnident.m.txt 24KB
nnimport.m.txt 32KB
nnmodref.m.txt 70KB
nncontrolutil.m.txt 738B
srchbacxc.m.txt 9KB
predopt.m.txt 12KB
Contents.m.txt 3KB
nndataimporthelp.m.txt 3KB
共 32 条
- 1
资源评论
- zhoujs19952019-03-29能不能开个代码文件说明,完全看不懂这些文件用来干嘛的
- 迈克猴2019-04-01完全看不懂这些文件用来干嘛的 ,乱七八糟的一堆文件
weixin_44191352
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功