Borrar filtros
Borrar filtros

Need help to solve following problem.

1 visualización (últimos 30 días)
Prabhath Manuranga
Prabhath Manuranga el 12 de Mzo. de 2024
Comentada: Prabhath Manuranga el 12 de Mzo. de 2024
X_ISMD = 995152.969208341;
Y_ISMD = 996113.117131325;
for i = 1:length(data1)
D1(i) = sqrt((X_ISMD - X_WGS84(i)).^2 + (Y_ISMD - Y_WGS84(i)).^2);
end
D1
length(data1) is 172. X_WGS84(i) and Y_WGS84(i) are 172 by 1 matrix. according to the above matlab code i ma getting following output (1 by 172 matrix). but i want to have 172 by 1 matrix. could you please suggest where should i change in my code? Thanks.
D1 =
Column 1
140911.995295475
Column 2
123232.133401588
Column 3
115208.35805542
Column 4
93127.1628328772

Respuesta aceptada

VBBV
VBBV el 12 de Mzo. de 2024
Editada: VBBV el 12 de Mzo. de 2024
X_ISMD = 995152.969208341;
Y_ISMD = 996113.117131325;
X_WGS84 =randn(172,1);
Y_WGS84 =randn(172,1);
for i = 1:172
D1(i) = sqrt((X_ISMD - X_WGS84(i)).^2 + (Y_ISMD - Y_WGS84(i)).^2);
end
D1 = D1.' % Transpose
D1 = 172×1
1.0e+06 * 1.4080 1.4080 1.4080 1.4080 1.4080 1.4080 1.4080 1.4080 1.4080 1.4080

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by