Scaling Data for Comparison

조회 수: 2 (최근 30일)
Shawn
Shawn 2012년 6월 6일
I have multiple arrays of different lengths that I would like to stretch/shrink for comparison. There are 90 trials of each task where I would like to plot diplacement vs. percent cycle. While I am able to normalize the percent cycle so I can graph multiple displacement vectors on top of one another, I cannot create a curve representative of the average of each of these displacement curves because each array has a different length.
I have tried using quantile(displacement, linspace(0,1,100)) to fit my curve into 100 equally spaced data points (representative of the percents) but it seems to rearrange my data points into increasing order.
Any suggestions as to how I can scale my data so the curves keep their shapes but I can also add vectors together for averaging?

채택된 답변

Walter Roberson
Walter Roberson 2012년 6월 6일
For each trial:
interp1( linspace(0, 1, length(displacement)), displacement, linspace(0,1,100) )
  댓글 수: 1
Shawn
Shawn 2012년 6월 6일
This worked very well. Thank you!

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by