selecting mid points

조회 수: 8 (최근 30일)
kash
kash 2012년 1월 7일
I have a values
F=[3 5 6 15 17 21 35 45 46 51 56 57 66 70 71 ]
now i want to calculate the mid points that is
i have to take 2 values that is(3,5)and (5,6) cal mid point(4,5.5)
next (5,6),(6,15) mid point is(5.5,10.5)
(6,15)and(15,17) mid point(10.5,16)
(15,17)and(17,21) mid point is(16,19)
and so on
please help

채택된 답변

Image Analyst
Image Analyst 2012년 1월 7일
Use convolution (a sliding window filter), conv():
F=[3 5 6 15 17 21 35 45 46 51 56 57 66 70 71 ]
F_mid = conv(F, [0.5 0.5], 'valid')
Results:
F =
3 5 6 15 17 21 35 45 46 51 56 57 66 70 71
f_mid =
Columns 1 through 12
4.0000 5.5000 10.5000 16.0000 19.0000 28.0000 40.0000 45.5000 48.5000 53.5000 56.5000 61.5000
Columns 13 through 14
68.0000 70.5000
  댓글 수: 1
kash
kash 2012년 1월 7일
Thanks a lot now can u please tell how to combine as
4,5.5
5.5,10.5
10.5,16
so on

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by