For any question write to : phy.vijayraj@gmail.com
fun = @(w)w*dose - SOBPDose;
% dose: simulated IDD dose, nⅹm matrix where n is beam number, m is simulated IDD dose of beam i at depth j.
% SOBPDose: target dose with length equals to m;
% initial weight of each mono-energetic beam with length n;
options = optimoptions(@lsqnonlin,‘Algorithm’,‘trust-region-reflective’,‘Display’,‘iter’, ‘MaxIterations’, 500);
FinalWeight = lsqnonlin(fun,w,lb,ub,options);
% FinalWeight: the optimized weight of each beam
% lb: lower boundary of weight
% upper boundary of weight
NEED A REVIEW