You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
706 B

%--------------------------
% @Author: Jingqiao Hu
% @Date: 2020-11-21 19:52:48
% @LastEditTime: 2021-11-28 15:30:04
%--------------------------
function [global_u, global_l] = global_u_l(u0, l0, u1, l1, rho)
global_u = cell(size(rho));
global_l = cell(size(rho));
for ele = 1:size(rho(:),1)
nele_mi = size(rho{ele}(:), 1);
u = zeros(nele_mi, 1);
l = zeros(nele_mi, 1);
for i = 1 : nele_mi
if rho{ele}(i)==1
u(i) = u1;
l(i) = l1;
else
u(i) = u0;
l(i) = l0;
end
end
global_u{ele} = u;
global_l{ele} = l;
end
end