find positive and nonzero roots of function matlab
조회 수: 8 (최근 30일)
이전 댓글 표시
sin(x)-0.1*x=0 find positive and nonzero roots . thank you
댓글 수: 0
답변 (1개)
Walter Roberson
2021년 12월 11일
f = @(x) sin(x) - x/10;
fplot(f, [-11, 11]);
yline(0)
You can see from this that there are 7 solutions. You can read the approximate positions from the graph, and use fzero() to find the exact locations.
댓글 수: 3
Torsten
2021년 12월 11일
As Walter pointed out, you will have to choose the starting point for fzero approximately at the position where the zero is located. This position can be seen from the above graph.
Walter Roberson
2021년 12월 11일
fzero() can only find one solution at a time; you will need to use several different starting points.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!