MATLAB Answers

Is it possible to use Simulink to train a neural network?

76 views (last 30 days)
I would like to know if it is possible to use Simulink to train a neural network.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 4 Nov 2020
Edited: MathWorks Support Team on 4 Nov 2020
The Neural Network Toolbox is optimum for training a neural network.
Whenever possible, use MATLAB command line syntax to first train your neural network. Once you have trained your neural network, you can use the GENSIM command from the Neural Network Toolbox to export the network to Simulink and simulate it. More information on the GENSIM function can be found at the following URL:
Another option would be to write a MATLAB file S-Function that will train your network adaptively. For general information on S-functions, visit the following URL:
Finally, the following URL shows a user-contributed file "nnsysid.zip" that demonstrates how you can use Simulink blocks to implement Neural Network algorithms:
Note that the MathWorks does not guarantee or warrant the use or content of user contributed submissions like the one above. Any questions, or issues should be directed to the contributing author.

  2 Comments

electronx engr
electronx engr on 14 Sep 2018
can we use system generator for the neural network created through GENSIM command?
Tobias Schulz
Tobias Schulz on 10 Dec 2020
How exactly does the training in a S-Function work? My Simulink model doesn't accept train or adapt

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!