'Polyfit' doesn't work

9 visualizaciones (últimos 30 días)
Dawid
Dawid el 7 de Dic. de 2013
Comentada: lalu uppumthara el 20 de Jun. de 2020
I have a problem in working with the the function "polyfit".
This is my script:
x=[0 2.05 3.1 4.8 5.6 6.8];
y=[0 2.74 6.1 18.3 27.4 36.6];
p=polyfit(x,y,6)
This is the error messsage I get from Matlab:
Attempt to execute SCRIPT polyfit as a function: C:\Users\Dawid\Desktop\Nowy folder\polyfit.m
Error in ==> polyfit at 3 p=polyfit(x,y,6)
How I can solve this problem? Thanks You very much.
  1 comentario
Image Analyst
Image Analyst el 25 de Mzo. de 2014
Original question in case he deletes it like he's done with others:
I have a problem in working with the the function "polyfit".
This is my script:
x=[0 2.05 3.1 4.8 5.6 6.8];
y=[0 2.74 6.1 18.3 27.4 36.6];
p=polyfit(x,y,6)
This is the error messsage I get from Matlab:
Attempt to execute SCRIPT polyfit as a function: C:\Users\Dawid\Desktop\Nowy folder\polyfit.m
Error in ==> polyfit at 3 p=polyfit(x,y,6)
How I can solve this problem? Thanks You very much.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 7 de Dic. de 2013
You accidentally named your own file polyfit.m which is interfering with using MATLAB's polyfit.m . You need to rename or delete your C:\Users\Dawid\Desktop\Nowy folder\polyfit.m

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by