Index exceeds the number of array elements (0).
Show older comments
I get this error
Index exceeds the number of array elements (0).
Error in Oil_Dilution_MR_Cars_analysis_1904_v1 (line 48)
timeseriesMatPurgeRequest{i}{I}.(A{J}).signals.values =
timeseriesMat.drives{i}.(A{J}).signals.values(PurgeRequestIdx{i}(PurgeRequestStartIdx{i}(I)):PurgeRequestIdx{i}(PurgeRequestEndIdx{i}(I)));
Not sure why??
Appreciate thoughts
for I =1: NumPurgeRequest{i}
disp(['Processing all data for purge request ' num2str(I)])
A={'ExM_tEgFld_ele2' 'ExM_mfEgFld_ele1','ExM_tWallFld_ele1','EngM_rNOxEngOut','eloil_eot','Outside_Air_Temp_Stat','Tra_numGear','Exh_tPFltUs','Exh_tOxiCatUs','Ignition_Status','InjCrv_phiPoI2Des','InjCrv_phiPoI1Des','AFS_dm','ThrVlv_rAct','NSC_dstLstDNOxRgn','InjCrv_phiPiI1Des','InjCrv_phiPiI2Des','CoEOM_numOpModeAct','EGRVlv_rAct','EGRVlvLP_rAct','CEngDsT_t','ApedPos_Pc_ActlArb','Epm_nEng','ATSys_dstLstRgn__0_','AirMon_dmAFSFlt_mp','PthSet_trqInrSet','ExM_mStrSOx_ExEle','ExM_mStrNOx_ExEle','LSU_rLam__1_','LSU_rLam__0_','ExM_tEgFld_ele3','ExM_tEgFld_ele4','ExM_tEgFld_ele6','ExM_mStrSot_ExFld__1_','ExM_ldSot_ExFld__0_','ExM_ldSot_ExFld__1_','Oil_tSwmp','EngDa_tEng','ATSys_noRgnAcvRul','ATSys_noATSysRgnReq','elomm_w_fio_out_01','eloil_vmo_oil_eng','OdometerMasterValue','VehV_v','InjCrv_qPoI1Des_mp','InjCrv_qPoI2Des_mp','InjCrv_qMI1Des','InjCrv_qMI1Set'};
for J=2:numel(A)
timeseriesMatPurgeRequest{i}{I}.(A{J}).signals.values = timeseriesMat.drives{i}.(A{J}).signals.values(PurgeRequestIdx{i}(PurgeRequestStartIdx{i}(I)):PurgeRequestIdx{i}(PurgeRequestEndIdx{i}(I)));
timeseriesMatPurgeRequest{i}{I}.(A{J}).time = [0; cumsum(diff(timeseriesMat.drives{i}.(A{J}).time(PurgeRequestIdx{i}(PurgeRequestStartIdx{i}(I)):PurgeRequestIdx{i}(PurgeRequestEndIdx{i}(I)))))];
end
1 Comment
Walter Roberson
on 19 Apr 2019
What happens if one of the PurgeRequestStartIdx{i} is empty because there is nothing requested to be purged for that item ?
Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!