You are trying to access element number 100 of the property dmPayoffObj
. However, this property is set to payOffObj
, which isn't an array. Thus the error.
What I think you wanted is return the Payoff of dmPayoffObj
. You should change the method mfGetDerivPayoff
of the class cVanillaDerivs
as follows:
function rslt = mfGetDerivPayoff(argSpotPrc)
rslt = obj.dmPayoffObj.mfGetPayoff(argSpotPrc);
end