x1=[1000 600 1200 500 300 400 1300 1100 1300 300];%收入 x2=[5 7 6 6 8 7 5 4 3 9];%價格 y=[100 75 80 70 50 65 90 100 110 60]';%需求量 x=[x1' x2']; rstool(x,y,'purequadratic')
擬合模式:函數
結果判斷spa
hours=1:12; temps=[5 8 9 15 25 29 31 30 22 25 27 24]; h=1:0.1:12; t=interp1(hours,temps,h,'spline'); plot(hours,temps,'+',h,t,hours,temps,'r:') xlabel('Hour'),ylabel('Degrees Celsius')
x=1:5; y=1:3; temps=[82 81 80 82 84;79 63 61 65 81;84 84 82 85 86]; mesh(x,y,temps)
xi=1:0.2:5; yi=1:0.2:3; zi=interp2(x,y,temps,xi',yi,'cubic'); mesh(xi,yi,zi) contour3(xi,yi,zi,[75,75],'r')%空間75等高線圖