how can I use fzero to this equation?

조회 수: 6 (최근 30일)
mar vouz
mar vouz 2016년 1월 7일
댓글: Star Strider 2016년 1월 7일
P(x)=polyfit(x,y,7)

답변 (1개)

Star Strider
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
mar vouz
mar vouz 2016년 1월 7일
thank you very much everyone!
Star Strider
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 CenterFile Exchange에서 Polynomials에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by