求matlab编程答:参考代码:1 2 3 4 5 6 7 8 9 function zd1829630755957934620 f=@(u)sqrt(u(1)^2+u(2)^2);[u,fval,flag] = fmincon(f,[1 1 50],[],[],[],[],[-inf -inf 45],[inf inf 55],@nlcon)[u,fval,flag] = fmincon(@(u)-f(u),[1 1 50],[],[],[],[],[-inf -...
MATLAB编程答:>> y=[1 3 0 20 20 4 18];>> x=0:length(y)-1;>>x1=-0.5:0.2:5.5;>> y1=interp1(x,y,x1,'spline');%三次样条插值 >> y1=interp1(x,y,x1,'cubic');%三次插值 >> plot(x,y,'ob')%画样本点o型蓝色 >> hold on >> plot(x1,y1,'r')%画三次样条插值曲线,...