مثلا اینطوری مینویسن
% show network
view(net)
figure;
plot(t','linewidth',2)
hold on
plot(y','r--')
grid on
legend('targets','network response','location','best')
ylim([-1.25 1.25])
% generate a grid
span = -1:.01:2;
[p1,p2] = meshgrid(span,span);
pp = [p1(
p2(
]';
% simulate neural network on a grid
aa = net(pp);
aa = full(aa);
% plot classification regions
figure(1)
mesh(p1,p2,reshape(aa,length(span),length(span))-5);
colormap cool
view(2)
یا اینطوری
[net,y,e] = adapt(net,p,p);
% view network structure
view(net)
% check final network parameters
disp('weights and bias of the adaptive after adaptation')
net.iw{1}
net.b{1}
%weights and bias of the adaptive after adaptation
%plot results
% transform result vectors
y = seq2con(y); y = y{1};
e = seq2con(e); e = e{1};
% start a new figure
figure;
% first graph
subplot(211)
plot(t,y,'b', t,y,'r--');
legend('original','prediction')
grid on
xlabel('time [sec]');
ylabel('target signal');
ylim([-1.2 1.2])
% second graph
subplot(212)
plot(t,e,'g');
grid on
legend('prediction error')
xlabel('time [sec]');
ylabel('error');
ylim([-1.2 1.2])