Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I want to build a neural network for a multi input and multi output (MIMO) system described as:

y1(t)= f1( x1(t), x2(t),...xn(t))
y2(t)= f2( x1(t), x2(t),...xn(t))
.....
.....
ym(t)= fm( x1(t), x2(t),...xn(t))

The book I read describes examples of single input single output system, mostly for function approximation of the form y= f(t), where the neural network is trained for input t (independent variable) and output y. I am using matlab neural network toolbox and the solution to the scalar case can easily be done. However, how do I construct or solve the MIMO problem ? How to I transform or represent the input or outputs to solve the problem with the matlab built in functions?

share|improve this question

1 Answer 1

First a very simple example:

1- First you need to make a Matrix for input data and another for output data. here I am using a pre-set data from matlab. You should try to make the structure of your input output data like this:

[InData,TarData] = engin_dataset;

so here we have two inputs and two outputs (MIMO) 2 --> 2 2- now you should create the network. I have chosen the feed-forward network:

net1 = newff(minmax(InData),[10,2],{'tansig','purelin'},'trainlm')

here I have defined the input data range, number of neurons in each layer (including output layer = 2), the type of functions and the type of the training algorithm.

3- Now you can train your network :

net2 = train(net1,InData,TarData)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

and here the code comes, from one of the examples generated automatically by matlab:

% load data
[inputs,targets] = engin_dataset;
%inputs = engineInputs;
%targets = engineTargets;

% Create a Fitting Network
hiddenLayerSize = 10;
net = fitnet(hiddenLayerSize);


% Setup Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;


% Train the Network
[net,tr] = train(net,inputs,targets);

% Test the Network
outputs = net(inputs);
errors = gsubtract(targets,outputs);
performance = perform(net,targets,outputs)

% View the Network
view(net)
share|improve this answer
    
check the question/answer in: stackoverflow.com/questions/1672850/… –  NKN Apr 19 '13 at 13:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.