没懂下标索引必须为正整数类型或逻辑类型,是什么意思,看了几遍也不知道错误在哪,有哪位前辈指点下么? 谢谢!
n_min=600;n_max=4000;
m1=2000;m0=1800;m=3880;
r=0.367;
eT=0.85;
f=0.013;
CDA=2.77;
i0=5.83;
If=0.218;Iw1=1.798;Iw2=3.598;
ig=[5.56294 2.76294 1.64294 1.00294 0.79294];
L=3.2;
a=1.947;
b=L-a;
hg=0.9;
g=9.8;
for i=1:5
n=(n_min:10:n_max);
N=n./1000;
Tq=-19.313+295.27.*N-165.44.*N.^2+40.874.*N.^3-3.8445.*N.^4;
s=2*pi*r*0.001;
Ft=Tq.*ig(i).*i0.*eT./r;
ua=n./ig(i)./i0.*60.*s;
Ff=m*g*f;
Fw=CDA.*ua.^2./21.15;
F=Ff+Fw;
k=Ff-(Ff+Fw);
i=tan(asin(k/(m*g)));
str=[*r*,*m*,*b*,*c*,*g*];
plot(ua,i,str(i));
grid on;
hold on;
end
xlabel(*ua(Km/h)*),ylabel(*i(%)*)
title(*汽车爬坡度图*)
legend(*一档爬坡度*,*二档爬坡度*,*三档爬坡度*,*四档爬坡度*,*五档爬坡度*)
下标索引必须为正整数类型或逻辑类型。
n_min=600;n_max=4000;
m1=2000;m0=1800;m=3880;
r=0.367;
eT=0.85;
f=0.013;
CDA=2.77;
i0=5.83;
If=0.218;Iw1=1.798;Iw2=3.598;
ig=[5.56294 2.76294 1.64294 1.00294 0.79294];
L=3.2;
a=1.947;
b=L-a;
hg=0.9;
g=9.8;
for i=1:5
n=(n_min:10:n_max);
N=n./1000;
Tq=-19.313+295.27.*N-165.44.*N.^2+40.874.*N.^3-3.8445.*N.^4;
s=2*pi*r*0.001;
Ft=Tq.*ig(i).*i0.*eT./r;
ua=n./ig(i)./i0.*60.*s;
Ff=m*g*f;
Fw=CDA.*ua.^2./21.15;
F=Ff+Fw;
k=Ff-(Ff+Fw);
i=tan(asin(k/(m*g)));
str=[*r*,*m*,*b*,*c*,*g*];
plot(ua,i,str(i));
grid on;
hold on;
end
xlabel(*ua(Km/h)*),ylabel(*i(%)*)
title(*汽车爬坡度图*)
legend(*一档爬坡度*,*二档爬坡度*,*三档爬坡度*,*四档爬坡度*,*五档爬坡度*)
下标索引必须为正整数类型或逻辑类型。