deleting a full colum using
이전 댓글 표시
I have a matrix with several optionprice data. Now I am trying to delete rows based on a for loop and if criteria. if the value of column 8 is >1.1 or <0.9, the whole row should be deletet. I have used the following code, but I always get an error message:
for i=1:numel(matrix)
if(matrix(i,8)>1.1)
matrix(i,:) = [];
end
end
댓글 수: 1
Jan
2013년 3월 17일
Please post the error message whenever you explain, that there is an error.
채택된 답변
추가 답변 (1개)
Locks
2013년 3월 17일
0 개 추천
댓글 수: 2
Azzi Abdelmalek
2013년 3월 17일
Sven, if the answer helped, click on accept this answer. Also, to add a comment, click on comment on this answer just under the answer.
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!