Using a trained regression model in simulink using Level 2 S-function block
이전 댓글 표시
Hello all,
I have trained a Gaussian Process Regression model and saved the model using 'saveCompactModel' (Matlab version R018). I want to use tThis trained model in Simulink using Matlab Level 2 S function and use it to predict output for the new input data.
In the matlab script for the level 2 S-function, I wrote the code for predicting the output, inside the 'output' function using the command predict(gprmdl, input). So for every input data, the output function predicts the output. I want to load the trained regression model 'gprmdl' only once. If i load the 'gprmdl' in the 'output' funcion, the simulation runs, but then the model is loaded for every iteration which slows the simulation down. According to the documentation, the 'start' function in the level 2 S-function script is used to initialize any parameters once before the simulation, using which i tried to load the 'gprmdl', but i got an error 'gprmdl not found'.
How do i load the regression model 'gprmdl' only once? I think i have to pass is as a parameter in to the level 2 S-function block, but I'm not sure how to do it. Is there a better to way to do it?
Thank you
댓글 수: 2
Vishal Sharma
2020년 8월 8일
I have the same issue
johnnynoc4sh
2021년 4월 20일
편집: johnnynoc4sh
2021년 9월 11일
Any mods around? I´m also interested in forecasting values during runtime on a realtime-target machine.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Gaussian Process Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!