how can I use fzero to this equation?
6 ビュー (過去 30 日間)
古いコメントを表示
P(x)=polyfit(x,y,7)
0 件のコメント
回答 (1 件)
Star Strider
2016 年 1 月 7 日
This is how I would do it:
x = -9:9; % Create Data
y = x.^3 - 2; % Create Data
p = polyfit(x,y,7); % Fit Polynomial
f = @(x,p) cos(sqrt(abs(polyval(p,x)))) - sin(x)/2; % Function
f_root = fzero(@(x) f(x,p), 1) % Find Root
7 件のコメント
Star Strider
2016 年 1 月 7 日
My pleasure!
The most sincere expression of thanks here on MATLAB Answers is to Accept the Answer that most closely solves your problem.
参考
カテゴリ
Help Center および File Exchange で Polynomials についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!