Clear Filters
Clear Filters

How to import KNN-model structure from matlab into simulink

11 views (last 30 days)
All,
The problem I am facing is a move of KNN-model data structure from matlab to simulink in a loop:
In matlab TrainingData is used as input to create an KNN based-model. In simulink, at some point, I want to use this model to predict the outcome of a certain decision based on certain parameters that evolve during simulation. If the simulation ends, the outcome of the decsion is used in matlab to adjust the TrainingData and to update the KNN-model. The updated KNN-model will be used for the next simutlation.
Note that before the loop starts, the feature table exists.
Note that in matlab, the knn-model data is the outcome of the command: knnmodel = fitcknn(TrainingData, 'feature'). So i need to import this knnmodel structure into simulink.
My problem is that I do not see how to successfully import such KNN-model into the simulink model for decision making (prediction).
Is there any method to get this done?

Answers (1)

Aneela
Aneela on 26 Jul 2024 at 9:53

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!