While loop homework problem
Mostrar comentarios más antiguos
For any number between -1 and 1, your program calculates and outputs the arccosine and arcsine of the number in both degrees and radians. (Example: if you enter 0, arccosine is either 90 degrees or π/2 radians, and 270 degrees or 3π/2 radians.) For your convenience, your answers can be between 0 and 180 degrees (π).
This is what I've been doing. I know its wrong...The thing is it has to be like beginner MATLAB level language. i=-1;
while i<=1
i=asin(i)
i=asind(i)
i=acos(i)
end n=-1
1 comentario
William
el 11 de Oct. de 2011
Bye the way it is bad to use "i" as variables in Matlab because it thinks "i" or "j" as the square root of -1 (Imaginary number)
Respuesta aceptada
Más respuestas (1)
William
el 11 de Oct. de 2011
for ii = -1:0.001:1
asind(ii)
asin(ii)
acosd(ii)
acos(ii)
end
1 comentario
Abdullah Tamimi
el 11 de Oct. de 2011
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!