<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
clc;
clear all;
close all;
p1=input('write the first sequence');
p2=input('write the 2nd sequence');
u=0.6;
b=0.3;
w=rand(1,2);
p=[p1:p2];
if(p1==0 && p2==0)
d=0;
p=[0.1 0.1];
for i=1:1000
ybar=(p*w')+b;
y=logsig(ybar);
e=d-y;
w=w+(p.*(2*u*e));
end
end