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!