'Polyfit' doesn't work

조회 수: 9 (최근 30일)
Dawid
Dawid 2013년 12월 7일
댓글: lalu uppumthara 2020년 6월 20일
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
Image Analyst
Image Analyst 2014년 3월 25일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2013년 12월 7일
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

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by