Cos function with Array
Afficher commentaires plus anciens
Hi, I am using cos function to calculate the cosine of an array as following:
a = th4_s1(2); %second element of my "th4_s1" array, which equals 1.5708
b = cos(a); %Matlab gives answer as 6.123e-17
c = 1.5708;
d = cos(1.5708); %Matlab gives answer as -3.6732e-6
Why are they so different? How can I avoid this error?
Thank you.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Array Geometries and Analysis dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!