Simulink's Stateful Predict block produces results that diverge from MATLAB's predict function when using the same trained network
6 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I trained an LSTM network to predict the contact force in a pneumatic polishing process. In MATLAB, the network's predict output using 'predict' function matches the measured force well, but when I deploy exactly the same network inside a Simulink 'Stateful Predict' block the predicted signal drifts and exhibits completly different result, as shown in the attached figure 1.
I attempted resolving this issue by adjusting Stateful Predict block settings and setting Simulink step time to match that used for neural-network training. However, despite these attempts, the results were always the same as in figure 1.
Questions
- What checklist or recommended workflow ensures identical results between MATLAB predict and Simulink Stateful Predict for the same network and inputs?
2. Is this discrepancy a known bug or something slated for a future patch?
Figure 1.
(Left) Results using Matlab predict function // (Right) Results using Simulink Stateful Predict block

Figure 2.
Simulink configuration state

2 件のコメント
Pratyush Swain
2025 年 7 月 16 日
Hi, can you share your model & script for reproducing the issue or atleast trimmed down version of it which still shows the discrepancy.
Thanks
Bahadir
2025 年 9 月 25 日 19:25
移動済み: Walter Roberson
2025 年 10 月 2 日 16:56
did you find any solution, ı have same problem.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Sequence and Numeric Feature Data Workflows についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!