Info

此问题已关闭。 请重新打开它进行编辑或回答。

In an assignment A(I) = B, the number of elements in B and I must be the same.

1 次查看(过去 30 天)
My code is given below.Anyone of you can correct it?
clear all clc r(10)=1; x(10)=[0.1 0.2]'; Phi_Phi =[1.1541 1.0407 0.9116 0.7726 1.0407 0.9549 0.8475 0.7259 0.9116 0.8475 0.7675 0.6674 0.7726 0.7259 0.6674 0.5943]; Phi =[0.1000 0 0 0 0.1800 0.1000 0 0 0.2440 0.1800 0.1000 0 0.2952 0.2440 0.1800 0.1000 0.3362 0.2952 0.2440 0.1800 0.3689 0.3362 0.2952 0.2440 0.3951 0.3689 0.3362 0.2952 0.4161 0.3951 0.3689 0.3362 0.4329 0.4161 0.3951 0.3689 0.4463 0.4329 0.4161 0.3951]; F =[0.8000 1.0000 1.4400 1.0000 1.9520 1.0000 2.3616 1.0000 2.6893 1.0000 2.9514 1.0000 3.1611 1.0000 3.3289 1.0000 3.4631 1.0000 3.5705 1.0000];
for k=10:20 BarRs=[1 1 1 1 1 1 1 1 1 1]'; Rs=BarRs*r(k); f=inv(Phi_Phi+10*eye(4)) g=(Phi'*Rs)-(Phi'*F*x(k)) deltau=f*g end
  1 个评论
Matt J
Matt J 2014-8-25
Yes. By highlighting the code and applying the formatting button
it will display much more neatly.

回答(1 个)

Manoj
Manoj 2014-8-25
编辑:Manoj 2014-8-25
In x(10), you have assigned two values which is not possible. It can accept only one value. You are trying to assign two values to one position.
Hope this helps

此问题已关闭。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by