MATLAB: Undefined function ‘predict’ for input arguments of type ‘classreg.​learning.p​artition.R​egressionP​artitioned​Linear’.

MATLABregression

After training model with cross validation:
model{i}=fitrlinear(xtrain',ytrain(i,:)','Crossval','on');
I try to use predict function
predict(model{i},xtest);
This worked fine when i didn't have cross validation flags in the fitrlinear function because the output was linear regression model. I looked on wiki for RegressionPartionedLinear object and its function is also called predict, but matlab giving me "undefined function" error.
How can I use the cross validated model?

Best Answer

What does this say
>> which -all predict
Also if you run the attached program, what does it say?