Formulation to Matlab code

How to write this formulation in Matlab:
form3.JPG
where p = 1; g is a vector; j= length(g); x is a vector
phi = sum( norm(max(0,g)) );
form4.JPG
phi = max( max(0,g) );
are they corect or not?

1 个评论

Ensure your max usage is correct
max(A,B) returns an array with the largest elements taken from A or B.
If this is correct for your application then the sum, norm is correct, you need to raise your first equation to the pth power also.

请先登录,再进行评论。

类别

在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息

产品

版本

R2018b

标签

提问:

2019-9-27

评论:

2019-9-27

Community Treasure Hunt

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

Start Hunting!

Translated by