How can I graph several points from a table and extrapolate a curve?
조회 수: 1 (최근 30일)
이전 댓글 표시
I'm somewhat new to MATLAB, although I used it in school. I have a table of x and y-values, and want to plot the points on a graph and then extrapolate a linear curve. Can someone help explain how to do this? I am used to graphing with equations, this is sort of the opposite way around.
댓글 수: 0
채택된 답변
dpb
2013년 12월 9일
Well, poly[fit|val] are "all in Matlab"...
dat=[1500,200; 2500,259; 4530,1980];
plot(dat(:,1),dat(:,2))
p=polyfit(dat(:,1),dat(:,2),1);
yhat=polyval(p,[1000 5000]);
hold on
plot([1000 5000],yhat)
추가 답변 (1개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!