clear allclose allclchold ontemp=[30.83600 30.13100 29.33600 27.90400 27.07000 26.31200 25.04400 24.21000 23.38900];point=[1 2 3 4 5 6 7 8 9];plot(point,temp,'x');p1 = polyfit(point(1:3),temp(1:3),1);f1 = polyval(p1,temp(1:3));p2 = polyfit(point(4:6),temp(4:6),1);f2 = polyval(p2,temp(4:6));p3 = polyfit(point(7:9),temp(7:9),1);f3 = polyval(p2,temp(7:9));plot(f1,temp(1:3))plot(f2,temp(4:6))plot(f3,temp(7:9))
MATLAB: I am planning to 3 sepearate fit line in a graph. But I encounter a problem. How to solve this
fit linegraph
Best Answer