How to initialize the class in MATALB?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I want to use 'fitrgp' function in Matlab Simulink.
fitrgp returns a GPmodel and its type of class is 'RegressionGP'.
for example:
y=fitrgp(rand(100,2),rand(100,1));
class(y)
ans =
'RegressionGP'
i used the matlab function block in MATLAB simulink and used the following code
function y = fcn()
coder.extrinsic('fitrgp');
y=fitrgp(rand(100,2),rand(100,1));
it gives me following error and recommends me to preinitialize the output.
Function output 'y' cannot be an mxArray in this context. Consider
preinitializing the output variable with a known type
how can i preinitialize this 'RegressionGP' class so that i can use 'fitrgp' command in MATLAB Simulink?
2 comentarios
Wooshik Kim
el 5 de Jul. de 2018
you can try initializing y
what is the output of fitrgp?
if it is an array, initialize y with an array of the same size
Respuestas (0)
Ver también
Categorías
Más información sobre Gaussian Process Regression en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!