How can I create a standalone application using my model from Regression Learner?

조회 수: 1 (최근 30일)
I have created a model using the Regression Learner on Matlab and am using the GPR algorithm, I wanted to create a standalone application to predict load consumption using this model, so used the help button and it said to use this function:
function ypred = mypredict(tbl)
%#function fitrgp
load('mymodel.mat');
ypred = trainedModel.predictFcn(tbl);
end
I used this and it said that I need to specify variables to load from the file, so I changed it to:
function ypred = mypredict(tbl)
%#function fitrgp
trainedModel= load('mymodel.mat');
ypred = trainedModel.predictFcn(tbl);
end
However, now it says that I do not have enough input arguments for the
ypred= trainedModel.predictFcn(tbl)
line.
Does anyone know what I have done wrong?
Thanks!

답변 (1개)

Sean de Wolski
Sean de Wolski 2021년 5월 2일
You need to get the data into the compiled app. Typically with compiling to an executable this would be by passing in a file name and having it read the file into a table and then write the results back to a file. Alternatively, you could put a simple user interface around it with a UI table.

카테고리

Help CenterFile Exchange에서 Gaussian Process Regression에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by