Neural Network Toolbox Previous page   Next Page
setx

Set all network weight and bias values with a single vector

Syntax

net = setx(net,X)

Description

This function sets a networks weight and biases to a vector of values.

net = setx(net,X)

Examples

Here we create a network with a two-element input, and one layer of three neurons.

net = newff([0 1; -1 1],[3]);

The network has six weights (3 neurons * 2 input elements) and three biases (3 neurons) for a total of nine weight and bias values. We can set them to random values as follows:

We can then view the weight and bias values as follows:

See Also

getx, formx


Previous page  seq2con sim Next page

© 1994-2005 The MathWorks, Inc.