%% Put together a sample domain and range: x=linspace(-4,4); y=sin(x)+0.4*randn(size(x)); %% Intialize a 1-10-1 network, then train it. net=feedforwardnet(10); net=train(net,x,y); %% Simulate the network using new input, plot the results: xt=linspace(-4,4,200); yt=sim(net,xt); plot(x,y,'.',xt,yt,'k-'); %% View the network architecture view(net)