MATLAB: How to obtain a Simulink block for a neural network created in MATLAB code

deepgensimlearningnarxNetworkneuralnn

I have a NARX neural network which I have prepared and trained in MATLAB.
How do I obtain a Simulink block which behaves in the same way?

Best Answer

You can use the 'gensim' function to generate the Simulink block. Please find more information about 'gensim' on the following page:
You then need to set the neural network Simulink block initial conditions with 'setsiminit', as well as correctly configure the system. Please find more information about 'setsiminit' on the following page:
If you notice discrepancies between the network in MATLAB and in Simulink, please check that the initial values are set properly in the Simulnk block using 'getsiminit'.
Refer to the attached script for a simple example on how to do so.