main.m
来自「此程序为训练RBF网权值的量子粒子群优化算法」· M 代码 · 共 40 行
M
40 行
clear;
format short
%input data sample x
%归一化-------------------------------------------------------
avg = mean(x); %求均值,c为各列均值组成的行向量
c=std(x); %求标准差
centerx=ones(M,1)*avg;
%x1=x-centerx;
%x2=x1./c(1);
%avg1=mean(x1)
P1=x(1:200,2:N)'% train sample data input
T1=x(1:200,1)'; %train sample data
P2=(x(1:450,2:N))' % simulation sample data input
T2=x000(1:450,1)'; % simulation sample data output
t=P1;
tic;
[parameters,MSE]=learnrbf(P1,T1,t);
time=toc;
Y1=output(P1,parameters,t);
Y2=output(P2,parameters,t);
figure(1)
plot(T1);
hold on;
plot(Y1,'r');
hold off;
figure(2);
plot(MSE);
figure(3)
plot(T2);
hold on;
plot(Y2,'r');
hold off;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?