I have the following code:
C_H = [C_H1 C_H2 C_H3 C_H4 C_H5];
PV = reshape(PV_SAM,[52560,1]);
j = 144;
b = zeros(144,5);
fun(i,:) = (C_H(i,:) - b(i).*PV(i));
f_sum = sum(fun,'all');
Does anyone know how to optimize the variable b so the value of f_sum is minimum?