从句柄函数中获取值

Get values from the handle function

我正在使用以下代码为我的数据拟合模型。

load fisheriris
x = meas(51:end,1:2);
y = (1:100)'>50;
cp = cvpartition(y,'k',10);
f = @(xtr,ytr,xte,yte)(predict fitglm(xtr,ytr,'linear','Distribution','binomial','Link','logit'),xte)
cfMat = crossval(f,x,y,'partition',cp);
cfMat = reshape(sum(cfMat),2,2)

如何获取handle函数给出的预测值?我的意思是包含拟合值的列向量。

我正在使用 MATLAB R2014a

括号放在正确的位置:

f = @(xtr,ytr,xte,yte) predict(fitglm(xtr,ytr,'linear','Distribution','binomial','Link','logit'),xte);