'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
  1 件のコメント
lalu uppumthara
lalu uppumthara 2020 年 6 月 20 日
it works

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by