Hi Robert,
I ran the OLGModel10 on the HPC, which has MATLAB 2022b installed, and received the following error messages:
Error using EvalFnOnAgentDist_Grid_J
Index exceeds the number of array elements. Index must not exceed 0.
Error in EvalFnOnAgentDist_AggVars_FHorz_Case1 (line 154)
Values=EvalFnOnAgentDist_Grid_J(FnsToEvaluate{ff},ParamCell,PolicyValuesPermute,l_daprime,n_a,n_z,a_gridvals,z_gridvals_J);
Error in EvalFnOnAgentDist_AggVars_FHorz_Case1_PType (line 186)
AggVars_ii=EvalFnOnAgentDist_AggVars_FHorz_Case1(StationaryDist_temp,
PolicyIndexes_temp, FnsToEvaluate_temp, Parameters_temp,
FnsToEvaluateParamNames_temp, n_d_temp, n_a_temp, n_z_temp, N_j_temp,
d_grid_temp, a_grid_temp, z_grid_temp, simoptions_temp);
Error in OLGModel10 (line 272)
AggVars=EvalFnOnAgentDist_AggVars_FHorz_Case1_PType(StationaryDist, Policy,
FnsToEvaluate, Params, n_d, n_a, n_z,N_j, N_i, d_grid, a_grid, z_grid_J,simoptions);
When I replaced AllVars with AllStats, I still encountered similar errors:
Error using EvalFnOnAgentDist_Grid_J
Index exceeds the number of array elements. Index must not exceed 0.
Error in EvalFnOnAgentDist_AllStats_FHorz_Case1_PType (line 393)
ValuesOnGrid_ii=EvalFnOnAgentDist_Grid_J(FnsToEvaluate.(FnsToEvalNames{ff}),CellOverAgeOfParamValues,PolicyValuesPermute_temp,l_daprime_temp,n_a_temp,n_z_temp,a_gridvals_temp,z_gridvals_J_temp);
Error in OLGModel10 (line 273)
AllStats=EvalFnOnAgentDist_AllStats_FHorz_Case1_PType(StationaryDist,Policy,FnsToEvaluate,Params,n_d,n_a,n_z,N_j,N_i,d_grid,a_grid,z_grid_J,simoptions);
However, the model ran perfectly on my desktop with MATLAB 2025b, so I’m unsure what caused the failure under the older MATLAB release.