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.

4 vues (au cours des 30 derniers jours)
clc
clear
x=500;
y=700;
x=110972.*a.*cos(b/2);
y=110972.*b.*cos(a/2);
a=
b=

Réponse acceptée

Star Strider
Star Strider le 14 Juin 2014
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

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by