how can ı use "minibatch​predict(ne​t,XTest);" command on simulink?

29 views (last 30 days)
I trained a LSTM network.
How can I use "scores = minibatchpredict(net,XTest);" and "YPred = predict(net, XTest);" commands on Simulink?

Answers (1)

AJ Ibraheem
AJ Ibraheem on 6 Oct 2025 at 13:16
Edited: Walter Roberson on 6 Oct 2025 at 16:32
The 'Stateful Predict' block might be what you're looking for. See https://uk.mathworks.com/help/deeplearning/ref/statefulpredict.html
  4 Comments
Bahadir
Bahadir 11 minutes ago
Thank you for your answer.
could you give more detail information about how to get same result on simulink. How to use predict command at matlab function block on simulink.
function y= fnc(u)
persistent net
if isempty(net)
net = coder.loadDeepLearningNetwork('32.mat');
end
input= [u];
input=rescale(input);
XTrain = {input'};
output= predict(net, XTrain);
y=output{1};
end

Sign in to comment.

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!