实用 MATLAB教学资料-19-20绘图续-最小二乘.pptVIP

  • 7
  • 0
  • 约6.05千字
  • 约 70页
  • 2017-06-04 发布于浙江
  • 举报

实用 MATLAB教学资料-19-20绘图续-最小二乘.ppt

9.1 最小二乘优化 三、线性最小二乘法的 MATLAB功能函数 三、线性最小二乘法的 MATLAB功能函数 原理 解超定方程组 XB=Y 1、矩阵左除 B=X \ Y XB=Y 2、广义逆矩阵 B=pinv(X)*Y 3、lsqlin CX=D [X,resnorm,residual,exitflag,output,lambda] =lsqlin(C,D,A,B,Aeq,Beq,lb,ub,x0,options) 3、lsqlin CX=D C,D-系数矩阵,右端向量 A,B:不等式约束,可选 Aeq,Beq: 等式约束,可选 lb,ub:自变量上下限,可选 x0:初值,可选 options:使用optimoptions指定优化参数,可选 如果第i个变量需要赋值,则它前面的所有变量都要顺序书写,没有数据可写为[ ]。 3、lsqlin 输出: X-模型参数 residual-残差向量,即CX-D resnorm-残差2-范数的平方,即残差平方和, exitflag-退出原因 output-优化计算信息 [X,resnorm,residual,exitflag,output,lambda] =lsqlin(C,D,A,B,Aeq,Beq,lb,ub,x0,options) CX=D 3、lsqlin [X,resnorm,residual,exitflag,output,lambda] =lsqlin(C,D) CX=D 数学模型: 功 能: 非负最小二乘解 4、lsqnonneg s.t. X ≥ 0 CX=D 4、lsqnonneg [x,resnorm,residual,exitflag,output] =lsqnonneg(C,D,options) CX=D 输入: C, D-系数矩阵,右端向量 options:使用optimset指定优化参数,可选 包括Display和TolX [x,resnorm,residual,exitflag,output] =lsqnonneg(C,D,options) 输出: X-模型参数 residual-残差向量,即XB-Y resnorm-残差 2-范数的平方 exitflag-退出原因 output-优化计算信息 例1 通过三道工序生产A,B,C三种产品,每道工序所需时间和可利用时间如表,求充分利用时间能生产多少产品。 工序 A,h B,h C,h 可利用时间,h 1 2 3 4 1500 2 1 4 5 2000 3 3 4 2 1600 [X,resnorm,residual,exitflag,output] =lsqlin(C, D, A, B, Aeq, Beq, lb, ub) [x,resnorm,residual,exitflag,output] =lsqnonneg(C,D) 例1 通过三道工序生产A,B,C三种产品,每道工序所需时间和可利用时间如表,求充分利用时间能生产多少产品。 工序 A,h B,h C,h 可利用时间,h 1 2 3 4 1500 2 1 4 5 2000 3 3 4 2 1600 MATLAB内置色图 autumn colorcube cool copper flag gray hot hsv jet lines pink prism spring summer white winter bone 第8章 数据的可视化 8.3 函数的可视化 ez 典型的函数绘图命令字头 1、功能函数 2、 ? 绘图途径 plot 根据散点绘图 ezplot 根据函数表达式绘图 显函数或隐函数 fplot 根据函数表达式绘图,显函数 一、ezplot 功能:绘制函数曲线 显函数an Explicit Function 或隐函数an Implicit Function 格式: ezplot(fun) ezplot(fun,[xmin,xmax]) ezplot(fun,[xmin,xmax,ymin,ymax]) 一、ezplot 格式: ezplot(fun

文档评论(0)

1亿VIP精品文档

相关文档