% Load the data points into Workspace
Points = [  -3    -2  -1.5  -1   -1    0    0    1; ...
           -0.5  -1.2  0.7   3  -3.5   2  -2.5  0.7];
Group = [   0      0    1    1    0    1    0    1];
% Assign training inputs and targets
P = Points; % inputs
T = Group; % targets
% Construct a two-input, single-output perceptron
net = newp (minmax (P), 1);
% Train the perceptron network with training inputs (p) and targets (t)
net = train (net, P, T);
% Simulate the perceptron network with same inputs again
a = sim (net, P);
%>> a =
%0 0 1 1 0 1 0 1 % correct classification
%>> T =
%0 0 1 1 0 1 0 1
% Querying the perceptron with inputs it never seen before
P9 = [-2; -3];
P10 = [0.5; 4];
a_P9 = sim (net, P9);
%>> a_P9 =
%0
a_P10 = sim(net, P10);
%>> a_P10 =
%1
%? the perceptron classifies P9 and P10 correctly.
