close all;clear;clc;
x = -10:0.03:9.99;
y = -9.99 : 0.03 : 10;
sinx = sin(x);
siny = sin(y);
for i=2:5
%x input
%sinx target
kjnet=newrbe(x,sinx,i); %使用 newrbe算法進行 NN訓練,i可選擇(徑向基函數擴展速度),具體可以查看API中的example
end
%figure(1);
%plotperf(tr);
NNReslut=sim(kjnet,y); %使用我們訓練出來的神經網絡
%figure(2);
%plot([p o1],'r');
figure(3);
plot(NNReslut,'b');
hold on;
plot(siny,'r');
title('red line =t,blue line=t+a');