? 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)
人气:241 ℃ 时间:2020-04-28 21:29:37
解答
In an assignmentA(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
当然,这样的赋值使用循环是低效的,因此不提倡
推荐
- 下面这段代码老是出现In an assignment A(I) = B, the number of elements in B and I must be the same
- MAtlab中To RESHAPE the number of elements must not change.
- The atomic number of an element X is 15.The number of electrons in an anion of X is?
- All matrices on a row in the bracketed expression must have the same number of rows.
- Can I write a letter --------(use) this pen?
- 在数轴上有一个电子跳蚤,第一次从原点0向右跳到表示数字1的点,第二次从表示数字1的点,向左跳动3个单位到数字-2的点,第三次从数字-2的点向右跳动5个单位到数字3的点,…,如果n是正整数,当n是奇数时,第n次向右跳动(2n-1)个单位,落在
- 太阳静静地躺在西方地平线上,变得如此之大,颜色是那样深黄、殷红
- I went to bed after i finished my homework.
猜你喜欢
- 《中国石拱桥》里面介绍石拱桥历史发展是以什么为顺序的啊?
- 求积分,dy/dx=(x-y-1)/(x+y+1)
- 若x的平方+ax-6a可分解因式为(x-2)(x+6),求a,b的值
- 长征三号运载火箭点升空时用到的物理知识有什么?
- 一根2米长的圆钢截成3段,表面积增加了24平方厘米,原来圆钢的体积是_立方分米.
- to,of,a,nuts,like,packet,i`d
- 遥远而不可及 一个词语?
- 我在电视上看到我过去的同学,李英在英语演讲比赛获得一等奖,我不禁回忆起以前的他,他过去时候是一个害羞女孩····几年没见,他眞的发生好大的变化,我为他感到骄傲.以这些内容写一篇英语作文!