How to use fnzeros to find the zeros of a function?
이전 댓글 표시
For example I have y=sin(x*5)+sin(x*2) and I need to find where y=0 between x=-10 and x=+10
채택된 답변
추가 답변 (1개)
Looks like you're meant to form a spline approximation to y=sin(x*5)+sin(x*2) using spmak and then apply fnzeros to get the zeros. You will probably want to use a small knot spacing and test agreement with the original y(x) via some plots.
Theoretically, it's not a bulletproof way of getting the zeros. A bulletproof method can't rely exclusively on numerical solvers like fzero or fnzero. It would require some prior analysis determine the minimal spacing between solutions, but as a homework exercise, I guess your instructor doesn't care.
카테고리
도움말 센터 및 File Exchange에서 Spline Postprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!