필터 지우기
필터 지우기

Finding the greatest value

조회 수: 2 (최근 30일)
shanmukh
shanmukh 2013년 5월 15일
i have a column D where i have to find the places greater than 10.
1
2
3
4
10
11
4
5
6
10
11
3
i am getting an answer 5,6,10,11.
if there are 2 values one after the other which satisfy >10, i need to skip the 5,10 and display only 6,11.
my final answer should only be 6,11
please help me out
  댓글 수: 1
Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 15일
Do you mean >=10?

댓글을 달려면 로그인하십시오.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 15일
편집: Azzi Abdelmalek 2013년 5월 15일
x=[1 2 3 4 10 11 4 5 6 10 11 1 2 ]
id=find(x>=10)
a=[diff(id) 20]
idx=id(find(a~=1))

추가 답변 (1개)

Jan
Jan 2013년 5월 15일
x = [1, 2, 3, 4, 10, 11, 4, 5, 6, 10, 11, 3];
m = x > 10;
m(strfind(m, [false, true])) = false;
index = find(m);

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by