Many applications use the following “small angle” approximation for the sine to obtain a simpler model that is easy to understand and analyze. This approximation states that sin x ≈ x, where x must be in radians. Investigate the accuracy of this approximation by creating three plots. For the first, plot sin x and x versus x for 0 ≤ x ≤ 1. For the second, plot the approximation error sin x - x versus x for 0 ≤ x ≤ 1. For the third, plot the relative error [sin(x) - x]/sin(x) versus x for 0 ≤ x ≤ 1. How small must x be for the approximation to be accurate within 5 percent?

댓글 수: 6

the cyclist
the cyclist 2023년 5월 21일
Please read this guide about getting help with homework, and edit your question accordingly.
Mahmoud Ibrahim
Mahmoud Ibrahim 2023년 5월 21일
The topic is not like that. I have a solution to the question, but I do not understand the code
Mahmoud Ibrahim
Mahmoud Ibrahim 2023년 5월 21일
편집: Mahmoud Ibrahim 2023년 5월 21일
this is the solution but why we used abs here in second plot and multi 100 in the third plot @the cyclist
The m-file:
x = 0:0.01:1;
subplot(2,2,1)
plot(x,sin(x),x,x)
xlabel('x (radians)'),ylabel('x and sin(x)')
gtext('x'),gtext('sin(x)')
subplot(2,2,2)
plot(x,abs(sin(x)-x))
xlabel('x (radians)'),ylabel('Error: sin(x) - x')
subplot(2,2,3)
plot(x,abs(100*(sin(x)-x))./sin(x))
xlabel('x (radians)'),... ylabel('Percent Error'),grid
the cyclist
the cyclist 2023년 5월 21일
My hypothesis is that you found this solution to your homework on the web, and you don't understand it.
I will give you a couple small hints, under the assumption that you would still like to learn.
Hint #1 (about using abs): If you are making an error, do you care what direction the error is in?
Hint #2 (about multiplying by 100): Think about what percent error means.
Mahmoud Ibrahim
Mahmoud Ibrahim 2023년 5월 21일
@the cyclist Bro i do not have an acc on this chegg site.
It is not homework
i just want to understand because i have an exam tomorrow and i solve many example to be ready
Steven Lord
Steven Lord 2023년 5월 21일
The information on this Wikipedia page may help you understand the use of abs and why the code multiplies by 100.

댓글을 달려면 로그인하십시오.

 채택된 답변

Image Analyst
Image Analyst 2023년 5월 21일

0 개 추천

This looks like a homework problem. If you have any questions ask your instructor or read the link below to get started:
Obviously we can't give you the full solution because you're not allowed to turn in our code as your own.
To learn fundamental concepts, invest 2 hours of your time here:

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics에 대해 자세히 알아보기

제품

질문:

2023년 5월 21일

댓글:

2023년 5월 21일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by