H = K;%The quadratic coefficient of the corresponding optimization problem
Unrecognized function or variable 'K'.
f = -diag(K);%The corresponding linear coefficient
Aeq = ones(1,n);%Equality constraints that need to be satisfiedAeq * alpha = beq
beq = 1;
lb = zeros(n,1);
C = 0.05;
ub = C * ones(n,1);
opts = optimoptions('quadprog', 'Algorithm', 'interior-point-convex', 'Display', 'off');
alpha = quadprog(H,f,[],[],Aeq,beq,lb,ub,[],opts);
Is there something wrong with my code for solving alpha? Why is the R-squared difference between some support vector points greater than 0 and less than C?

1 件のコメント

Dyuman Joshi
Dyuman Joshi 2025 年 10 月 15 日
It's not clear what you want to do. As you can see, there are undefined variables in the code above.
It would be easier for us to understand and provide feedback/suggestions if you provided a description (in words not code) and a background of what you're trying to do/solve.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Systems of Nonlinear Equations についてさらに検索

タグ

質問済み:

2025 年 10 月 15 日

コメント済み:

2025 年 10 月 15 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by