clear all
close all
clc
f1=zeros(1,100);
f2=zeros(1,100);
f3=zeros(1,200);
c1=randi([1,20],1,100);
c2=randi([1,20],1,100);
y(1,1:200)=rand(1,200);
f1(1,1:100)=[y(1,1:100).*c1];
f2(1,1:100)=[y(1,101:200).*c2];
f3(1,1:200)=horzcat(f1,f2);
g1=zeros(1,100);
g2=zeros(1,100);
g1=gradient(f1,y(1:100));
g2=gradient(f2,y(101:200));
g=horzcat(g1,g2);
my question is whether g1 and g2 are sub-gradients of f1 and f2 respectively in the above code

4 件のコメント

Walter Roberson
Walter Roberson 2018 年 12 月 22 日
What is a "sub-gradient" for this purpose?
Note: what you have is not exactly equivalent of
g = graient(f3, y(1:200))
There would be a difference due to boundary conditions. Compare
gradient([1 3 6 10 15])
to
[gradient([1 3 6]), gradient([10 15])]
Siva
Siva 2018 年 12 月 24 日
i required the sub gradients to apply decomposition. without using 'g=horzcat (g1,g2)'. can i write the primal decomposition by using 'g1' and 'g2'.
Walter Roberson
Walter Roberson 2018 年 12 月 24 日
What is a "sub gradient" ?
Siva
Siva 2018 年 12 月 25 日
sub gradient method as used in lagrangian decomposition and lagrangian relaxation algorithms

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

 採用された回答

Walter Roberson
Walter Roberson 2018 年 12 月 25 日

0 投票

my question is whether g1 and g2 are sub-gradients of f1 and f2 respectively in the above code
No. Lagrangian sub-gradient methods apply to functions, but you do not have functions.
gradient() applied to numeric matrices is numeric differences, and the second and following arguments give the step sizes.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMathematics and Optimization についてさらに検索

製品

リリース

R2015b

質問済み:

2018 年 12 月 22 日

回答済み:

2018 年 12 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by