Index exceeds matrix dimensions.
2 次查看(过去 30 天)
显示 更早的评论
Hello! The code below shows two sections for deleting rows according to two conditions. They are exactly the same but for some reason i get the 'Index exceeds matrix dimensions' error. Any idea what am i missing here?
aod_siglowp = mean_aodcoarsePEARL - (3*sigaodPEARL);
aod_sighighp = mean_aodcoarsePEARL +(3*sigaodPEARL);
reff_siglowp = mean_reffcoarsePEARL - (3*sigma_p(1,2));
reff_sighighp = mean_reffcoarsePEARL + (3*sigma_p(1,2));
coarsep_aod = cp(:,1);
cond1_aod = coarsep_aod(:,1) > aod_sighighp;
cond2_aod = coarsep_aod(:,1) < aod_siglowp;
delerowsaod = or(cond1_aod,cond2_aod);
coarsep_aod(delerowsaod,:)=[];
coarsep_reff = cp(:,2);
cond1_reff = coarsep_reff(:,1) > reff_sighighp;
cond2_reff = coarsep_reff(:,1) < reff_siglowp;
deleterows2 = or(cond1_reff,cond2_reff);
coarsep_reff(deleterows2,:)=[];
when entering the second section line by line...the line below is where i get the error (combining the two logical conditions to be able to delete the rows)
>>deleterows2 = or(cond1_reff,cond2_reff);
Index exceeds matrix dimensions.
5 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!