If in the state set the final state is a set with one possible state (setSingleItem) the ADPSBI algorithm returns an error. If however I use (setBasic) and add a dummy state the code runs fine. It might be something you might want to look into.
Sampled Backward Induction ([0.002] ksamples/period)
Creating empty post-decision value functions (LocalAvg)
T=25 (terminal period): Done
T=24: SError using StorageSetDecisionApply (line 14)
Index exceeds matrix dimensions.
Error in adpSBI (line 223)
parfor samp = 1:samp_per_time
Error in Storage_Demo (line 38)
results_SBI = adpSBI(Storage_problem,adp_opt);
If in the state set the final state is a set with one possible state (setSingleItem) the ADPSBI algorithm returns an error. If however I use (setBasic) and add a dummy state the code runs fine. It might be something you might want to look into.