Nihe=zeros(6,2);
Weilai=zeros(6,20);
for j=1:6;
%figure(j)
grid on
hold on
subplot(3,2,j)
%figure(j)
hold on
load f:\data_a4.txt
Data_ok=data_a4;
Data_ok=Data_ok(:,3:2:13);
%枯水期
plot(Data_ok(1:9:90,j),'-*b')
plot(Data_ok(2:9:90,j),':*b')
plot(Data_ok(3:9:90,j),'-.*b')
%legend('枯水期全流域','枯水期干流','枯水期支流',)
%丰水期plot(Data_ok(3:9:90,j),'-.*b')
plot(Data_ok(4:9:90,j),'or')
plot(Data_ok(5:9:90,j),'r')
plot(Data_ok(6:9:90,j),'-.or')
%legend('丰水期全流域','丰水期干流','丰水期支流',)
%水文年
plot(Data_ok(7:9:90,j),'-xg')
plot(Data_ok(8:9:90,j),':xg')
plot(Data_ok(9:9:90,j),'-.xg')
switch j
case 1
xlabel('I类水')
case 2
xlabel('II类水')
case 3
xlabel('III类水')
case 4
xlabel('IV类水')
case 5
xlabel('V类水')
case 6
xlabel('VI类水')
end
if j>=3;
x=1:10;
X=[ones(1,length(x))',x'];
y=Data_ok(7:9:90,j);
[b,bint,r,rint,stats]=regress(y,X,0.05);
t=1:20;
Nihe(j,=b;
yt=b(1)+b(2).*t';
WeiLai(j,=yt(1:20);
plot(t,yt,'LineWidth',2,'Color','k')
end
if j==1;
x=1:10;
X=[ones(1,length(x))',x'];
y=Data_ok(7:9:90,j);
[b,bint,r,rint,stats]=regress(log(y),X,0.05)
t=1:20;
Nihe(j,=b;
yt=b(1)+b(2).*t';
ytt=exp(yt);
WeiLai(j,=ytt(1:20);
plot(t,ytt,'LineWidth',2,'Color','k')
end
if j==2;
x2=5:10;
X2=[ones(1,length(x2))',x2'];
y2=Data_ok(43:9:90,j);
[b2,bint2,r2,rint2,stats2]=regress(y2,X2,0.05)
t2=1:20;
Nihe(j,=b;
yt2=b2(1)+b2(2).*t2';
WeiLai(j,=yt2(1:20);
plot(t2,yt2,'LineWidth',2,'Color','k')
end
aa=[174 179 183 189 207 234 220.5 256 270 285];
tt=1:10;
plot(tt,aa/10,'--*c')
Xf=[ones(1,length(tt))',tt'];
[bf,bintf,rf,rintf,statsf]=regress(aa',Xf,0.05)
tf=1:20;
ytf=bf(1)+bf(2).*tf';
plot(tf,ytf/10,'LineWidth',1,'Color','r')
grid on
end
??? X=[ones(1,length(x))',x'];
|
Error: Missing variable or function