What is wrong with this?

조회 수: 1 (최근 30일)
mar vouz
mar vouz 2016년 1월 5일
댓글: mar vouz 2016년 1월 5일
Hey I wrote:
X=linspace (0,1,8)
Y=A (13:20,2)
(I had "A" form my last program)
P=polyfit (X,Y,7)
And it says error using polyfit X and Y vectors must be the same size! But they are same sized!!!I don't know what's wrong with it!

채택된 답변

the cyclist
the cyclist 2016년 1월 5일
They have the same number of elements, but they are not the same shape. You need to transpose one of them.
  댓글 수: 3
the cyclist
the cyclist 2016년 1월 5일
P=polyfit(X,Y.',7)
FYI, you could have found this by trying
docsearch transpose
which will turn up (among other things) this documentation page.
mar vouz
mar vouz 2016년 1월 5일
Thank you very much for your help!!

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

추가 답변 (0개)

카테고리

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