【问题标题】:quadratic programming with linear constraints(Matlab)具有线性约束的二次规划(Matlab)
【发布时间】:2014-04-30 20:32:26
【问题描述】:

我需要在 matlab 中使用 quadprog 时最小化 alpha

1/2*alpha.'*H*alpha+(-1.')*alpha

subject to: y.'alpha=0 and 0<=alpha<=inf

我已经制作了矩阵H

    for a=1:8

    for b=1:8

    H(a,b)=y(a)*y(b)*dot((x(a)).',x(b));

    end

end

但我不确定是否必须做出限制

【问题讨论】:

    标签: matlab quadratic


    【解决方案1】:

    这行得通吗?

    n = size(H,1);
    f = -ones(n,1);       // linear term
    aeq = randn(1,n);     // equality constraint
    lb = zeros(n,1);      // lower bound
    ub = inf * ones(n,1); // upper bound
    alpha = quadprog(H,f,[],[],aeq,0,lb,ub)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-24
      • 1970-01-01
      • 1970-01-01
      • 2016-09-18
      相关资源
      最近更新 更多