Need help to solve following problem.

2 ビュー (過去 30 日間)
Prabhath Manuranga
Prabhath Manuranga 2024 年 3 月 12 日
コメント済み: Prabhath Manuranga 2024 年 3 月 12 日
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

回答 (1 件)

VBBV
VBBV 2024 年 3 月 12 日
編集済み: VBBV 2024 年 3 月 12 日
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
  1 件のコメント
Prabhath Manuranga
Prabhath Manuranga 2024 年 3 月 12 日
Thanks VBBV

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by