NARX export to Simulink time step

3 Ansichten (letzte 30 Tage)
Sohrab Allahyari
Sohrab Allahyari am 26 Feb. 2024
Beantwortet: Tejas am 21 Aug. 2024
Hello,
I want to export my trained model to Simulink using MATLAB's "Export to Simulink " option. I have a problem exporting the NARX network with the time constant. My simulation step size is 0.001, but the trained NARX network block overlooks the step size and uses 1 second as the step size visible in the picture.
I didn't experience this when I worked with MLP networks. How can I adjust the step size when exporting the block?
Thank you

Antworten (1)

Tejas
Tejas am 21 Aug. 2024
Hello Sohrab,
When exporting a NARX network block to Simulink, the gensim function can be used to adjust the sample time as needed. There are two ways to do this:
  • By directly specifying the sample time by providing the network as the first input and the sample time as the second input.
gensim(net, 0.001);
  • Using name-value pair to specify the sample time, especially when dealing with multiple inputs, as demonstrated in the example below.
[sysName,netName] = gensim(net,'SampleTime',0.001,'InputMode','Workspace',...
'OutputMode','Workspace','SolverMode','Discrete');
The following documentation can be referred to get more information on gensim function: https://www.mathworks.com/help/releases/R2022b/deeplearning/ref/network.gensim.html .

Kategorien

Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange

Produkte


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by