⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.m

📁 用RBF人工神经网络的智能算法,实现预测功能
💻 M
字号:
X=(-pi:0.1:pi)'
Y=sin(X)
gam = 10;
sig2 = 0.3;
type = 'function estimation';
[alpha,b] = trainlssvm({X,Y,type,gam,sig2,'RBF_kernel'});
[alpha,b] = trainlssvm({X,Y,type,gam,sig2,'RBF_kernel','original'});
[alpha,b] = trainlssvm({X,Y,type,gam,sig2,'RBF_kernel','preprocess'});
Xt=(-pi:0.1:pi)'
Yt = simlssvm({X,Y,type,gam,sig2,'RBF_kernel','preprocess'},{alpha,b},Xt);
figure; plotlssvm({X,Y,type,gam,sig2,'RBF_kernel','preprocess'},{alpha,b});
hold on;  plot(Xt,Yt,'r-.'); hold off
nb=length(Xt)
Yp = predict({X,Y,type,gam,sig2}, Xt, nb)
hold on;  plot(Xt,Yp,'b-.'); hold off

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -