Help with script please!!! pic included!!
이전 댓글 표시
I really need help on how to approach the problem. Does anyone know how to go about it or are there any examples like this one? Thank you so much!!!! the picture attached has the problem.
this is what I have this so far:
x= input('Please provide a radian:');
if cos(x)< 10^-20
disp('Invalid value.');
else
cos(x)>=10^-20;
tan(x)=abs(sin(x)/cos(x));
fprint('Tan(x) of the value is %f\n',tan(x));
end
댓글 수: 4
per isakson
2014년 11월 11일
편집: per isakson
2014년 11월 11일
Your approach is fine. There are, however, a few syntax errors in your code. Did you get any error messages?
Mikhail
2014년 11월 11일
just delete line cos(x)>=10^-20;
Pam
2014년 11월 11일
Image Analyst
2014년 11월 11일
You can use the "d" versions so you don't need to convert and you can just enter the values directly in degrees: cosd(), sind(), tand(), atan2d(), etc.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Lengths and Angles에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!