selecting mid points

13 次查看(过去 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