How can I find roots of my interpolated functions?
이전 댓글 표시
Dear community,
I want to use 'fzero' to find the root of my equation. but unfortunately it doesn't work. it gives me this error:
Error using fzero (line 169) FUN must be a function, a valid string expression, or an inline function object
Error in anchoring (line 49) x = fzero(fun,x0)
The related part of my MATLAB code is:
theta_00 = 0:1e-6:3.5;
y_1 = interp1(theta_0, dtheta,theta_00, 'spline');
y_2 = interp1(theta_0, dtheta, theta_00, 'spline');
fun = y_1 - y_2;
x0 = [0 3.5];
x = fzero(fun,x0)
y_1 is belongs to some experimental data but y_2 has a function. I interpolate both of them. Here I do not know why am I getting this error. how can I find these crossing point?

Thanks
답변 (1개)
Moj
2014년 12월 12일
댓글 수: 2
Mohammad Abouali
2014년 12월 12일
1) Don't comment to with new answer. There is "Comment on this Answer" button that you can use.
2) check the comment that below the answer that I provided to see what is going wrong.
Moj
2014년 12월 12일
카테고리
도움말 센터 및 File Exchange에서 Interpolation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!