I am assuming that you are attempting to fit a polynomial for 2 vectors only, at a time.
In the present code polynomial is fitted to a 3-dimensional data set, giving rise to a surface plot.
Following code may help you:
pairList = nchoosek(1:8,2);
pl=pairList';
for ii = 1:size(pl,2)
M=metriche(:,pl(:,ii));
x=M(:,1);
y=M(:,2);
p=polyfitn(x,y,1);
polyn2sympoly(p)
R(ii)=p.R2;
coeff(:,ii)=p.Coefficients;
end
Hope this helps