While loop homework problem
Show older comments
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 Comment
William
on 11 Oct 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)
Accepted Answer
More Answers (1)
William
on 11 Oct 2011
for ii = -1:0.001:1
asind(ii)
asin(ii)
acosd(ii)
acos(ii)
end
1 Comment
Abdullah Tamimi
on 11 Oct 2011
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!