NARX export to Simulink time step

조회 수: 4 (최근 30일)
Sohrab Allahyari
Sohrab Allahyari 2024년 2월 26일
답변: Tejas 2024년 8월 21일
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

답변 (1개)

Tejas
Tejas 2024년 8월 21일
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 .

카테고리

Help CenterFile Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by