필터 지우기
필터 지우기

I need some help to solve non-linear equation with three unknowns and three knowns with having 170 different values for one known.

조회 수: 1 (최근 30일)
Xw, Yw, Zw (170 * 1 matrices) are known with 170 different values.
Xe, Ye, Ze are the unknowns.
Tx, Ty, Tz, Rx, Ry, Rz, and neta are some of other knowns.
I want to find the values for Xe, Ye, and Ze.

채택된 답변

Torsten
Torsten 2024년 2월 21일
편집: Torsten 2024년 2월 21일
M = [eta+1,Rz,-Ry;-Rz,eta+1,Rx;Ry,-Rx,eta+1];
M = repmat(M,170,1);
b = [];
for i = 1:170
b = [b;Xw(i)-Tx;Yw(i)-Ty;Zw(i)-Tz];
end
sol = M\b;
Xe = sol(1)
Ye = sol(2)
Ze = sol(3)
  댓글 수: 6
Torsten
Torsten 2024년 2월 23일
:-)
M = [eta+1,Rz,-Ry;-Rz,eta+1,Rx;Ry,-Rx,eta+1];
dM = decomposition(M);
Xe = zeros(170,1);
Ye = zeros(170,1);
Ze = zeros(170,1);
for i = 1:170
b = [Xw(i)-Tx;Yw(i)-Ty;Zw(i)-Tz];
sol = dM\b;
Xe(i) = sol(1);
Ye(i) = sol(2);
Ze(i) = sol(3);
end

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Prabhath Manuranga
Prabhath Manuranga 2024년 2월 28일
편집: Prabhath Manuranga 2024년 2월 28일
g_mean = g_i + 0.0424*H_i % Equation 01
H_i = (W_lvd - W_i)/g_mean % Equation 02
Here g_i, H_i, and W_i is known.
W_lvd is unkonwn.
There are 172 row values per g_i and H_i (170 by 1 matrix).
How to solve this?
  댓글 수: 1
Torsten
Torsten 2024년 2월 28일
W_lvd = H_i.*(g_i+0.0424*H_i)+W_i
if you want W_lvd as a 170x1 matrix
W_lvd = 1/170*sum(H_i.*(g_i+0.0424*H_i)+W_i)
if you want W_lvd as the best approximate value for the vector values H_i.*(g_i+0.0424*H_i)+W_i

댓글을 달려면 로그인하십시오.


Prabhath Manuranga
Prabhath Manuranga 2024년 3월 12일
편집: Walter Roberson 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
Walter Roberson
Walter Roberson 2024년 3월 12일
X_ISMD = 995152.969208341;
Y_ISMD = 996113.117131325;
D1 = zeros(length(data1),1);
for i = 1:length(data1)
D1(i) = sqrt((X_ISMD - X_WGS84(i)).^2 + (Y_ISMD - Y_WGS84(i)).^2);
end
D1

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by