Hello.I have this matrix
A=[116 3;107 6;114 6;119 6;117 9;120 9;108 15
;113 18;115 18;112 21;111 24]
.I want to detect local maximums from second column and where local max happened that row should be kept in a new matrix. here (112 21) & (111 24) should be saved in matrix B. can any one help me plz?

댓글 수: 1

Stephen23
Stephen23 2016년 2월 22일
편집: Stephen23 2016년 2월 22일
@ Fateme Jalali: please stop posting duplicate questions. You have posted this four times so far. It does not help you get an Answer! If you want to give more information just write comments to this Question.

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

답변 (1개)

Image Analyst
Image Analyst 2016년 2월 22일

0 개 추천

You can get the local max with imdilate():
A=[116 3;107 6;114 6;119 6;117 9;120 9;108 15
;113 18;115 18;112 21;111 24]
windowSize = 3;
maxCol2 = imdilate(A(:,2), true(windowSize, 1))
I'm not sure why you have only two rows instead of local max for every row.

카테고리

도움말 센터File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

질문:

2016년 2월 22일

편집:

2016년 2월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by