problem using the find function
조회 수: 2 (최근 30일)
이전 댓글 표시
hi, i'm trying to use the find function to locate specific values form matrix array and to remove them (as you can see in the attached m-file) https://www.dropbox.com/s/bcynkiblh7n8tr5/check_values_s_ds_script.m
i use the function like this:
[row,col] = find(resault>0.899 & resault < 1);
but still i find values that are greater then 1 (some are even 50) what am i doing wrong?
댓글 수: 4
Azzi Abdelmalek
2014년 2월 3일
I don't know how you got those figures, but I can assure you that
row,col] = find(resault>0.899 & resault < 1)
will find only location of numbers that are between 0.899 and 1
채택된 답변
추가 답변 (2개)
Amit
2014년 2월 3일
row and col are the indices in the matrix which have the value you need. Find function just finds the indices which satisfy the condition, however find function does not replaces those values.
댓글 수: 0
Azzi Abdelmalek
2014년 2월 3일
편집: Azzi Abdelmalek
2014년 2월 3일
What you want is
resault(resault>0.899 & resault < 1)
Maybe what you mean by remove them
resault(resault>0.899 & resault < 1)=0
Removing an element doesn't mean set it to zero. Also you can't remove a element from a nxm matrix, you can remove an entire column or row.
댓글 수: 1
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!