I get an error in the loop
1 次查看(过去 30 天)
显示 更早的评论
K=[27 27320.5963 4223312.4563
32 25496.3840 4221760.5030
34 28874.9170 4221756.7649
39 27284.2609 4220235.3943
133 26812.2676 4221811.7328]
olc=[0.00000
70.76351
105.09584
0.00000
42.40162
89.83755
0.00000
50.28006
98.61182
0
36.51504
106.45528
0
80.90273
160.68555
276.73136]
dn=[27;27;27;32;32;32;34;34;34;39;39;39;133;133;133;133]
bn=[34;133;32;27;133;39;39;133;27;32;133;34;27;34;39;32]
dog_olc=[dn bn olc]
R=6373394
for i = 1:length(dog_olc)
dn=dog_olc(i,1); bn=dog_olc(i,2); olc=dog_olc(i,3);
xi=K(find(K(:,1)==dn,2)); yi=K(find(K(:,1)==dn,3));
xk=K(find(K(:,1)==bn,2)); yk=K(find(K(:,1)==bn,3));
dt=((-200/pi)/(6*R^2))*((xk-xi)*(2*yi+yk));
Dog_olc(i)=dog_olc(3,i)+dt
end
There are results visually. I do not succeed in getting these results.
0 个评论
采纳的回答
KSSV
2017-3-30
clc; clear all ;
K=[27 27320.5963 4223312.4563
32 25496.3840 4221760.5030
34 28874.9170 4221756.7649
39 27284.2609 4220235.3943
133 26812.2676 4221811.7328] ;
olc=[0.00000
70.76351
105.09584
0.00000
42.40162
89.83755
0.00000
50.28006
98.61182
0
36.51504
106.45528
0
80.90273
160.68555
276.73136] ;
dn=[27;27;27;32;32;32;34;34;34;39;39;39;133;133;133;133] ;
bn=[34;133;32;27;133;39;39;133;27;32;133;34;27;34;39;32] ;
dog_olc=[dn bn olc] ;
N = size(dog_olc,1) ;
R=6373394 ;
Dog_olc = zeros(N,1) ;
for i = 1:N
dn=dog_olc(i,1); bn=dog_olc(i,2); olc=dog_olc(i,3);
xi=K(find(K(:,1)==dn,2)); yi=K(find(K(:,1)==dn,3));
xk=K(find(K(:,1)==bn,2)); yk=K(find(K(:,1)==bn,3));
dt=((-200/pi)/(6*R^2))*((xk-xi)*(2*yi+yk));
Dog_olc(i)=dog_olc(i,3)+dt ;
end
Dog_olc
4 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!