Using a trained regression model in simulink using Level 2 S-function block

1 回表示 (過去 30 日間)
Shreevatsa P S
Shreevatsa P S 2020 年 7 月 15 日
編集済み: johnnynoc4sh 2021 年 9 月 11 日
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
Vishal Sharma 2020 年 8 月 8 日
I have the same issue
johnnynoc4sh
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 件)

カテゴリ

Help Center および File ExchangeGaussian Process Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by