%% Construct and Train a Cascade-Forward Neural Network
% This example shows how to use a cascade-forward neural network to solve a simple problem.
% Load the training data.

[x,t] = simplefit_dataset;

% The 1-by-94 matrix x contains the input values and the 1-by-94 matrix t contains the associated target output values.
% Construct a cascade-forward network with one hidden layer of size 10.

net = cascadeforwardnet(10);

% Train the network net using the training data.

net = train(net,x,t);

% View the trained network.

view(net)

% Estimate the targets using the trained network.

y = net(x);

% Assess the performance of the trained network. The default performance function is mean squared error.

perf = perform(net,y,t)

% Copyright 2020 The MathWorks, Inc.