MATLAB Answers

How to export a Classification Learner model into a Simulink block

17 views (last 30 days)
JiFeng Zhang
JiFeng Zhang on 9 Jun 2020
Commented: Vishal Sharma on 24 Jul 2020 at 12:31
In my Simulink model, I want a block which can classify 5 input signals into 7 class. I use the Classification Learner App and trained in fine KNN, but I don‘t know how export the training result into a Simulink block that I can use in my model. Just like when I train a neural network and use 'gensim' to obtain a Simulink block.


Sign in to comment.

Answers (1)

Sean de Wolski
Sean de Wolski on 9 Jun 2020
I find it's easier to generate the code from the classification learner, copy out just the fit*() algorithm and retrain it to a model. Then save that model and then put that into a Simulink function like in this example:
The output from classification learner directly is hard to use otherwise.