Problem on bisection method in MATLAB
古いコメントを表示
Write a program in MATLAB which will give as output all the real solutions of the equation sin(x)=x/10. The solutions should be accurate up to the second decimal place and should be obtained using the bisection method. Note that the program should be written efficiently i.e, a loop should be introduced so that the bisection method is applied repeatedly to obtain all the solutions (starting values should not be entered manually for each root). The program should display all the solutions as output.
回答 (2 件)
Ameer Hamza
2020 年 10 月 20 日
0 投票
Study the code in the following FEX packages, and then you can write your own code for the homework
4 件のコメント
raj k
2020 年 10 月 21 日
Ameer Hamza
2020 年 10 月 21 日
There are infinitely many choices of end-points. How to choose which one to use in for-loop.
John D'Errico
2020 年 10 月 21 日
If you understand it, then you need to make an effort. surely you can find pseudo-code for a bisection method? If so, then look how the loop is structured. Now think about how loops work in MATLAB. The mode effort you make, the more likely you will get help. Show the code you are writing. look at it. Think about how it must work. Look at the code you wrote, and ask why it did not work.
raj k
2020 年 10 月 22 日
Andy
2020 年 10 月 22 日
0 投票
Valid starting points for a and b are the turning points of the function sin(x)-(x/10)=0. Determine the turning points then use tp(1) and tp(2) as the first a and b, then tp(2) tp(3)
3 件のコメント
raj k
2020 年 10 月 22 日
Andy
2020 年 10 月 22 日
tp(1) is the first turning point, tp(2) is the second and so on.
You can write code to determine the turning points by differentiating the function and finding the peaks. There is a findpeaks function on file exchange.
shubh aggarwal
2020 年 10 月 28 日
@ raj k can you share the final code if your problem was solved
カテゴリ
ヘルプ センター および File Exchange で Code Execution についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!