필터 지우기
필터 지우기

I want to calculate the value of a & b for "x=110972.*a.*cos(b/2);" & " y=110972.*b.*cos(a/2);" equation where x=500 and y=700. But i can't, Please help me out. Thanks in advance.

조회 수: 1 (최근 30일)
clc
clear
x=500;
y=700;
x=110972.*a.*cos(b/2);
y=110972.*b.*cos(a/2);
a=
b=

채택된 답변

Star Strider
Star Strider 2014년 6월 14일
This works:
x = 500;
y = 700;
% a = p(1), b = p(2)
fn = @(p) norm(x - 110972.*p(1).*cos(p(2)/2)) + norm(y - 110972.*p(2).*cos(p(1)/2));
[ab, fval] = fminsearch(fn, [1 1]);
fprintf(1,'\n\ta = %f\n\tb = %f\n\n',ab)
x2 = 110972.*ab(1).*cos(ab(2)/2)
y2 = 110972.*ab(2).*cos(ab(1)/2)
producing:
a = 0.004506
b = 0.006308
x2 =
500.0003e+000
y2 =
700.0000e+000

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by