While loop homework problem
Ältere Kommentare anzeigen
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 Kommentar
William
am 11 Okt. 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)
Akzeptierte Antwort
Weitere Antworten (1)
William
am 11 Okt. 2011
for ii = -1:0.001:1
asind(ii)
asin(ii)
acosd(ii)
acos(ii)
end
1 Kommentar
Abdullah Tamimi
am 11 Okt. 2011
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!