Matlab, how to create non linear curve from random data?
3 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
Walter Roberson
2012-4-22
curvedegree = 2; %set as desired
coeffs = polyfit(x, y, curvedegree);
plot(x, polyval(coeffs, x)); %plot fitted y
2 个评论
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 Center 和 File Exchange 中查找有关 Interpolation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!