各位前辈好,我想请教一下如何在MATLAB中做对数回归下,效果图如下:
我自己做了线性回归,代码和图如下,可是如何进行对数回归呢,谢谢
for iYrs=2012201559;
iy=iYrs;
sy=num2str(iy);
eval(['load ' Folder Site '_' sy '_Summary Time B Bstd C Cstd EF EFstd gs gsstd VPD VPDstd VWC VWCstd']);
nt=length(Time);
Variance=EFstd;
y=EF;
x=VWC;
X=[ones(length(x),1),x];
[b,bint,r,rint,stats]=regress(y,X);
b,stats
figure(1);
h1=plot(x,y,'MarkerFaceColor',[0 0 0],'MarkerSize',3,'Marker','o',...
'LineStyle','none',...
'Color',[0 0 0])
Y=X*b;
hold on
h2=plot(x,Y,'linewidth',1,'color','k');
set(gca,'XLim',[10 20]);
set(gca,'XTick',[10,12,14,16,1