How to determine if angles match
Mostra commenti meno recenti
I am trying to write code to determine when two precession angles match. Matlab keeps skipping to the last else statement regardless of which elseif statement should be taking precedence.
prec1 = rad2deg(acos(C21./sin(deg2rad(nutation))));
prec2 = rad2deg(asin(C31./sin(deg2rad(nutation))));
if abs(prec1 - prec2) < 10^-3
prec = prec1;
elseif abs(prec1 - (180 - prec2))< 10^-3
prec = prec1;
elseif abs((360 - prec1) - prec2) < 10^-3
prec = prec2;
else
prec = 360 - prec1;
end
4 Commenti
Image Analyst
il 20 Feb 2024
That's not what happens when we run your code. We get that C21 is not defined. What is prec1 and prec2, or what is C21, C31, and nutation?
Adam Danz
il 20 Feb 2024
We can't follow the logic without knowing C21, C31, and while we're at it, nutation.
Madeleine
il 20 Feb 2024
Madeleine
il 20 Feb 2024
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su MATLAB Report Generator in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!