MATLAB: Need help understanding example “Porfolio Optimization Against a Benchmark” Step 5

financial benchmarkFinancial Toolboxfunctioninforatiotargetreturnportfolio optimizationportobjtargetreturn

I am working through a Mathworks example (link below) and am now stuck on Step 5 of 7. I am creating a function, but in the example, there is no end point. I am also not understanding what the 'targetReturn' and 'portObj' are supposed to be. I am following the example word for word. Any help on this section will be greatly appreciated!
P.S. I am extremely new to matlab, please be kind

Best Answer

I believe to have answered my own question.
I created a new, separate script for the function. I then called the function with the command "type infoRatioTargetReturn.m' with the remaining code (starting at "objFun...").
Now it looks like: type infoRatioTargetReturn.m objFun = @(targetReturn) -infoRatioTargetReturn(targetReturn, pAct); options = optimset('TolX', 1.0e-8); [optPortRetn, ~, exitflag] = fminbnd(objFun, 0, max(portRetnAct), options); [optInfoRatio, optWts] = infoRatioTargetReturn(optPortRetn, pAct); optPortRisk = estimatePortRisk(pAct, optWts)
I was able to get a value for the optPortRisk and continue with the example.