Issues with for loop
이전 댓글 표시
I currently have this for loop in my code. Where RawDataMatrix is a 549x41 matrix.
for i = 1:length(RawDataMatrix(:,1))
if RawDataMatrix(i,35) > 10
RawDataMatrix(i,:) = [];
else
end
end
RawDataMatrix(:,35) = [];
I want this loop to go through each row and if the value of that row at column 35 is greater than 10 I want to delete the entire row from the matrix. Then after that I would like to delete the entire column 35 which is what that last line of code is for. I am currently getting this error code:
Index in position 1 exceeds array bounds (must not exceed 549).
Error in SEMMaster_DustIncluded_EdgeExcluded_withCuK_V1 (line 31)
if RawDataMatrix(i,35) > 10
I believe I am getting this error because in the workspace it says that i = 550 which I am not sure why. Thank you in advance if you can help me!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!