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
當然,這樣的賦值使用循環(huán)是低效的,因此不提倡
? In an assignment A(I) = B, the number of elements in B and I must be the same.
? 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)
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)
英語人氣:847 ℃時間:2020-04-28 21:29:37
優(yōu)質解答
我來回答
類似推薦
- 下面這段代碼老是出現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.
- father went to his doctor for __ about his heart trouble.
- 4×27.5÷2x=8 4分之3-5分之1x=20% 怎么解這兩個方程
- 怎么用鍵盤輸入根號,圓周率等數學符號呢?
- x(x+1)(x-1)=120
- 把一個分數的分子擴大到原來的5倍,分母縮小為原來的五分之一,這個分數的值就()
- 設A(-1,0)、B(1,0),直線L1、L2分別過A、B兩點,且L1、L2的斜率之積為-4,求L1與L2的交點的軌跡方程?
- 癟乒乓球放入熱水鼓起的原因時熱脹冷縮還是溫度變化導致壓強增大
- 最后一頭戰(zhàn)象一課寫戰(zhàn)象臨死前做了哪些事?先簡單的寫一些再寫出自己的體會
猜你喜歡
- 1英語翻譯
- 2遞等式計算如下(有2題,)
- 3請看看
- 4英語翻譯
- 5一道關于勻變速直線運動的高一物理題
- 6描寫三峽山陡水窄的句子是什么?
- 7成語,( )以名(
- 8甲乙兩個修路隊合修一條路,甲先修了全長的4/5,少4千米,接著乙修的長度是甲的一半,就全部修完了,乙隊
- 9獵豹的平均速度約是31.4米/秒,羚羊的平均速度是23.4米/秒.如果現在一只羚羊在一只獵豹前39米處開始逃跑,那么這只獵豹經過多長時間可以追上這只羚羊?(得數保留整數)
- 1013和7的最大公因數是多少?
- 11心事沉重,吃不下飯用什么詞語表示
- 12據測算,每10平方米的樹林明年可以吸收空氣中的有害氣體40克,某市計劃營造一條35000平方米的林帶,造成一年可以吸收多少千克有害氣體?