I get an error in the loop

1 visualización (últimos 30 días)
Muhendisleksi
Muhendisleksi el 29 de Mzo. de 2017
Comentada: Muhendisleksi el 30 de Mzo. de 2017
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.

Respuesta aceptada

KSSV
KSSV el 30 de Mzo. de 2017
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 comentarios
Muhendisleksi
Muhendisleksi el 30 de Mzo. de 2017
Editada: Muhendisleksi el 30 de Mzo. de 2017
dt(1,1)= ((-200/pi*10000)/(6*R^2))*((4221756.7650-4223312.4563)*(2*27320.5963+28874.917))
Dog_olc(1,1)=0.339375914157676
This should be the process.
Muhendisleksi
Muhendisleksi el 30 de Mzo. de 2017
I saw my mistake! thank you very, very much.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by