Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
error-The data sites should be distinct.

Subject: error-The data sites should be distinct.

From: srishti

Date: 24 Oct, 2012 11:29:08

Message: 1 of 3

load x.txt
 x = x';
 % maximum envelope
maxi=[];
mapo=[];
for i=1:250:200000;
    [c,d]=max(x(i:i+250));
    maxi=[maxi,c] % maximum value in a window
    mapo=[mapo,d+(i-1)]; %position of maximum value in a window
end
     yy =spline(mapo,maxi,1:200000);
   plot(mapo,maxi,'o',1:200000,yy);

I am getting an error- "The data sites should be distinct." for the spline command.

Subject: error-The data sites should be distinct.

From: Roger Stafford

Date: 24 Oct, 2012 14:15:09

Message: 2 of 3

"srishti " <srishti.sondele@gmail.com> wrote in message <k68je4$3vr$1@newscl01ah.mathworks.com>...
> [c,d]=max(x(i:i+250));
- - - - - - - - - -
  The line "[c,d]=max(x(i:i+250));" makes each window 251 elements long, so they each must overlap by one element. Somewhere along the line the common element of two consecutive windows must have been the maximum for each window, thereby giving you a repeated maximum window value, which 'spline' objects to.

Roger Stafford

Subject: error-The data sites should be distinct.

From: srishti

Date: 24 Oct, 2012 15:43:08

Message: 3 of 3


Thank you so much sir for your help.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us