how can I use fzero to this equation?

6 visualizaciones (últimos 30 días)
mar vouz
mar vouz el 7 de En. de 2016
Comentada: Star Strider el 7 de En. de 2016
P(x)=polyfit(x,y,7)

Respuestas (1)

Star Strider
Star Strider el 7 de En. de 2016
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 comentarios
mar vouz
mar vouz el 7 de En. de 2016
thank you very much everyone!
Star Strider
Star Strider el 7 de En. de 2016
My pleasure!
The most sincere expression of thanks here on MATLAB Answers is to Accept the Answer that most closely solves your problem.

Iniciar sesión para comentar.

Categorías

Más información sobre Polynomials en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by