Calculate median at every interval

조회 수: 1 (최근 30일)
IMC
IMC 2021년 7월 15일
답변: Cris LaPierre 2021년 7월 15일
My data comprises of 2 variables X (25x1) and Y(25x1). I want to calculate X median at each interval of Y and then plot it. Kindly suggest me how to perform this task? Thank you.
X = [16.01, 19.23, 18.47, 4.84, 35, 27.75, 21.4, 33.6, 38.77, 35.26, 34.28, 16.01, 32.93, 12.65, 47.14, 47.42, 15.68, 31.88, 23.6, 29.3, 27.75, 27.91, 30.1, 29.3]
Y = [-2.12, -13.41, -30.29, -23.64, -10.11, -17.22, 13, 10, -2.12, 11, -4.65, -34.12, -12.11, 10, 14, -23.64, -13.41, -50.53, -64.12, -17.22, -2.12, 13, 17, -21.99, -9.78]

답변 (1개)

Cris LaPierre
Cris LaPierre 2021년 7월 15일
Consider using either movmean or movmedian. The result will be the same when you are looking at pairs of numbers.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by