필터 지우기
필터 지우기

Matlab, how to create non linear curve from random data?

조회 수: 1 (최근 30일)
uncung fgv
uncung fgv 2012년 4월 22일
example i have data
x=linspace(4,6,7) %data x from 4 until 6 with 7 elements
y=linspace(8,17,7)
i will create hiperbolik data or non linear randomly in matlab

답변 (1개)

Walter Roberson
Walter Roberson 2012년 4월 22일
curvedegree = 2; %set as desired
coeffs = polyfit(x, y, curvedegree);
plot(x, polyval(coeffs, x)); %plot fitted y
  댓글 수: 2
uncung fgv
uncung fgv 2012년 4월 23일
why the plot still liniear?
my data:
>> x=linspace(6.502,6.9,5)
>> y=linspace(63.5,75.39,5)
still linear?
Jan
Jan 2012년 4월 23일
Because you fit a parabola to a line.
Where are the random data you are talking of in the subject line?
What about: y = rand(size(x))?

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by