? In an assignment A(I) = B, the number of elements in B and I must be the same.nmin=600,nmax=4000,m1=2000,m2=1800,m3=3880,r=0.367,gt=0.85,f=0.013,cda=2.77,io=5.83,Ifo=0.218,Iw1=1.798,Iw2=3.598,l=3.2,a=1.947,hg=0.9,ig1=5.56 ig=[5.56 2.769 1.644 1.00
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/11 22:48:52
![? In an assignment A(I) = B, the number of elements in B and I must be the same.nmin=600,nmax=4000,m1=2000,m2=1800,m3=3880,r=0.367,gt=0.85,f=0.013,cda=2.77,io=5.83,Ifo=0.218,Iw1=1.798,Iw2=3.598,l=3.2,a=1.947,hg=0.9,ig1=5.56 ig=[5.56 2.769 1.644 1.00](/uploads/image/z/8646846-6-6.jpg?t=%3F+In+an+assignment+A%28I%29+%3D+B%2C+the+number+of+elements+in+B+and+I+must+be+the+same.nmin%3D600%2Cnmax%3D4000%2Cm1%3D2000%2Cm2%3D1800%2Cm3%3D3880%2Cr%3D0.367%2Cgt%3D0.85%2Cf%3D0.013%2Ccda%3D2.77%2Cio%3D5.83%2CIfo%3D0.218%2CIw1%3D1.798%2CIw2%3D3.598%2Cl%3D3.2%2Ca%3D1.947%2Chg%3D0.9%2Cig1%3D5.56+ig%3D%5B5.56+2.769+1.644+1.00)
? In an assignment A(I) = B, the number of elements in B and I must be the same.nmin=600,nmax=4000,m1=2000,m2=1800,m3=3880,r=0.367,gt=0.85,f=0.013,cda=2.77,io=5.83,Ifo=0.218,Iw1=1.798,Iw2=3.598,l=3.2,a=1.947,hg=0.9,ig1=5.56 ig=[5.56 2.769 1.644 1.00
? In an assignment A(I) = B, the number of elements in B and I must be the same.
nmin=600,nmax=4000,m1=2000,m2=1800,m3=3880,r=0.367,gt=0.85,f=0.013,cda=2.77,io=5.83,Ifo=0.218,Iw1=1.798,Iw2=3.598,l=3.2,a=1.947,hg=0.9,ig1=5.56
ig=[5.56 2.769 1.644 1.00 0.793]
n=nmin:10:nmax
T=-19.313+295.27*(n/1000)-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/1000).^4;
for j=1:5
ft(j)=(T*ig(j)*io*gt)/r
ua(j)=(0.377*n*r)/(ig(j)*io)
end
plot(ua,ft)
? In an assignment A(I) = B, the number of elements in B and I must be the same.nmin=600,nmax=4000,m1=2000,m2=1800,m3=3880,r=0.367,gt=0.85,f=0.013,cda=2.77,io=5.83,Ifo=0.218,Iw1=1.798,Iw2=3.598,l=3.2,a=1.947,hg=0.9,ig1=5.56 ig=[5.56 2.769 1.644 1.00
In an assignment A(I) = B, the number of elements in B and I must be the same
中文解释:在赋值语句 A(I) = B 中,B 和 I 的元素个数必须相同
出错原因:I 和 B 的维数、大小不一样.这正如“把 5 个水果放到 6 个篮子”、或者“把 6 个水果放到 5 个篮子”,均无法实现
解决办法:自己设置断点调试一下,看看 I 和 B 的维数、大小是否相同,不同的话就要修改成两者一致
举例:
【错误代码】:
代码:
b = [1,2];
s(1) = b;
【正确代码】:
代码:
b = [1,2];
for i = 1:2
s(i) = b(i);
end
当然,这样的赋值使用循环是低效的,因此不提倡