How to use of 'prediction block' in Simulink

14 ビュー (過去 30 日間)
Gang Gyoo Jin
Gang Gyoo Jin 2025 年 9 月 20 日 11:01
コメント済み: AJ Ibraheem 2025 年 10 月 6 日 13:14
% One-dimension data was generated and the tranined net was save to 'TrainedNetwork_for_Simulation.mat'
% Generate data
t = 0:0.1:50;
y = sin(t) + 0.1 * randn(size(t));
% Train the network
net= feedforwardnet;
net = train(net,t,y);
% Save the trained network
save('TrainedNetwork_for_simulink', 'net');
% I'm trying to use a trained network in a Simulink model(TestPredict.slx), but I'm getting an error. The error message indicates that
% Error in 'TestPredict/Predict': Failed to evaluate mask initialization commands.
% Caused by:
% MAT file TrainedNetwork_for_simulink.mat does not contain a valid SeriesNetwork, DAGNetwork, dlnetwork, yolov2ObjectDetector or an %% % ssdObjectDetector object.
  1 件のコメント
AJ Ibraheem
AJ Ibraheem 2025 年 10 月 6 日 13:14
The 'Predict' block does not support the network type that you've trained.
Try training your network using trainnet instead, see https://uk.mathworks.com/help/deeplearning/ref/trainnet.html

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by