车流量问题.docVIP

  • 15
  • 0
  • 约1.53千字
  • 约 7页
  • 2016-12-28 发布于江苏
  • 举报
已知数据绘制图像 差值拟合以后就算得到车流量图像 0:01--8:00 function [C,L]=lagran(X,Y) % input - X is a vector that contains a list of abscissas % - Y is a vector that contains a list of ordinates % output - C is a matrix that contains the coefficients of the lagrange interpolatory polynomial %- L is a matrix that contains the lagrange coefficients polynomial w=length(X); n=w-1; L=zeros(w,w); for k=1:n+1 V=1; for j=1:n+1 if k~=j V=conv(V,poly(X(j)))/(X(k)-X(j)); end end L(k,:)=V; end C=Y*L; x=[0.0 2.0 4.0 5.0 6.0 7.0]; y=[2 2 0 2 5 8]; lagran111(x,y) ans = 0.0077 -0.1940 1.7423

文档评论(0)

1亿VIP精品文档

相关文档