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:
interpolation

Subject: interpolation

From: May

Date: 10 Jul, 2009 16:26:02

Message: 1 of 6

Hi,

I would like to interpolate these data points by introducing 1000 points between them. I tried with interp1,interp1q and so on but never successful.. At the end of the interpolation, the length should be 1000.

 How can i do it.

Thank you.

12,937816
-5,5461250
-89,460672
-89,403476
-3,1421940
12,9378160
-16,9801060
-14,3993970
-22,1121080
-12,3421940
-12,3421940
-11,4078500
-14,2800600
-12,3421940
-12,3421940
-12,3421940
-12,342194
-12,342194
-12,342194
-12,342194
-3,5401940
-3,5401940
-21,144194
-27,012194
-3,5401940
-3,5401940
-3,5401940
-46,996888
6,85207900
-6,4741940
-6,4741940
-6,4741940
-3,5401940
-6,4741940
-6,4741940
-6,4742100
-6,4742280
-6,4742470
-6,4742670
-6,4742900
-6,4743150
-6,4743170
-6,4743520
-3,5403520
5,26164800
-11,3795130
-72,2053200
-33,8663840
-11,3795130
-11,3795130
-11,3795130
-11,3795130
-11,3795130
-11,3795130
-11,379513
-11,3795130
-11,3795130
-11,3795130
-11,3795130
-11,3795130
-11,379513
2,60178400
-0,231746
12,937816
12,937816

Subject: interpolation

From: Faraz Afzal

Date: 10 Jul, 2009 23:44:02

Message: 2 of 6

Add a little more details..

1. These commas used are representing the separator as in MATLAB Language or it is a point or each data point is in millions etc etc...

2. 1000 points between any two entries or distributed amongst the given data points.

3. this data really makes no sense to me.. for interpolation to be accurate there has to be some sensible connection between two consecutive points or there is no interpolation..
I hope it makes the situation clear..

More details you supply the best help we can do...

Regards,
Faraz.

"May " <xrayspectrum@gmail.com> wrote in message <h37q2q$9tp$1@fred.mathworks.com>...
> Hi,
>
> I would like to interpolate these data points by introducing 1000 points between them. I tried with interp1,interp1q and so on but never successful.. At the end of the interpolation, the length should be 1000.
>
> How can i do it.
>
> Thank you.
>
> 12,937816
> -5,5461250
> -89,460672
> -89,403476
> -3,1421940
> 12,9378160
> -16,9801060
> -14,3993970
> -22,1121080
> -12,3421940
> -12,3421940
> -11,4078500
> -14,2800600
> -12,3421940
> -12,3421940
> -12,3421940
> -12,342194
> -12,342194
> -12,342194
> -12,342194
> -3,5401940
> -3,5401940
> -21,144194
> -27,012194
> -3,5401940
> -3,5401940
> -3,5401940
> -46,996888
> 6,85207900
> -6,4741940
> -6,4741940
> -6,4741940
> -3,5401940
> -6,4741940
> -6,4741940
> -6,4742100
> -6,4742280
> -6,4742470
> -6,4742670
> -6,4742900
> -6,4743150
> -6,4743170
> -6,4743520
> -3,5403520
> 5,26164800
> -11,3795130
> -72,2053200
> -33,8663840
> -11,3795130
> -11,3795130
> -11,3795130
> -11,3795130
> -11,3795130
> -11,3795130
> -11,379513
> -11,3795130
> -11,3795130
> -11,3795130
> -11,3795130
> -11,3795130
> -11,379513
> 2,60178400
> -0,231746
> 12,937816
> 12,937816

Subject: interpolation

From: May

Date: 11 Jul, 2009 08:06:03

Message: 3 of 6

Hi Faraz,

1. These comma used here are just a point. (They are not millions or separators).
2. 1000 points to be distributed amongst the whole datasets.
3. yes i agree with you that the data is little bit strange. But i have no option I want to introduce many points in between the whhole dataset. I thought the only way is by interpolation.

thanks you for your help.........


"Faraz Afzal" <farazafzal@gmail.com> wrote in message <h38jo2$6qg$1@fred.mathworks.com>...
> Add a little more details..
>
> 1. These commas used are representing the separator as in MATLAB Language or it is a point or each data point is in millions etc etc...
>
> 2. 1000 points between any two entries or distributed amongst the given data points.
>
> 3. this data really makes no sense to me.. for interpolation to be accurate there has to be some sensible connection between two consecutive points or there is no interpolation..
> I hope it makes the situation clear..
>
> More details you supply the best help we can do...
>
> Regards,
> Faraz.
>
> "May " <xrayspectrum@gmail.com> wrote in message <h37q2q$9tp$1@fred.mathworks.com>...
> > Hi,
> >
> > I would like to interpolate these data points by introducing 1000 points between them. I tried with interp1,interp1q and so on but never successful.. At the end of the interpolation, the length should be 1000.
> >
> > How can i do it.
> >
> > Thank you.
> >
> > 12,937816
> > -5,5461250
> > -89,460672
> > -89,403476
> > -3,1421940
> > 12,9378160
> > -16,9801060
> > -14,3993970
> > -22,1121080
> > -12,3421940
> > -12,3421940
> > -11,4078500
> > -14,2800600
> > -12,3421940
> > -12,3421940
> > -12,3421940
> > -12,342194
> > -12,342194
> > -12,342194
> > -12,342194
> > -3,5401940
> > -3,5401940
> > -21,144194
> > -27,012194
> > -3,5401940
> > -3,5401940
> > -3,5401940
> > -46,996888
> > 6,85207900
> > -6,4741940
> > -6,4741940
> > -6,4741940
> > -3,5401940
> > -6,4741940
> > -6,4741940
> > -6,4742100
> > -6,4742280
> > -6,4742470
> > -6,4742670
> > -6,4742900
> > -6,4743150
> > -6,4743170
> > -6,4743520
> > -3,5403520
> > 5,26164800
> > -11,3795130
> > -72,2053200
> > -33,8663840
> > -11,3795130
> > -11,3795130
> > -11,3795130
> > -11,3795130
> > -11,3795130
> > -11,3795130
> > -11,379513
> > -11,3795130
> > -11,3795130
> > -11,3795130
> > -11,3795130
> > -11,3795130
> > -11,379513
> > 2,60178400
> > -0,231746
> > 12,937816
> > 12,937816

Subject: interpolation

From: Husam Aldahiyat

Date: 11 Jul, 2009 08:14:03

Message: 4 of 6

Maybe ECM algorithm would help.

Subject: interpolation

From: Faraz Afzal

Date: 11 Jul, 2009 10:09:03

Message: 5 of 6

Hi...

I dont know if it helps or not.... i tried but lets see what u like..

first of all i must tell u that linear interpolation between 2 points is a process of joining them with a linear straight line.. Now if i see ur data for example take like 11 and -72 and joining them two say with 1000 samll points between them is still a straight line....
..

if i go for some spline quadratic or cubic spline interpolation then it would not be define between these two widely spaced points...

anywayz this is what i did.. and u r allowed to play with all possibilities of interp1...

first of all replace all commas with points or MATLAB take is as a separator between two elements..
then
          format long
          A = [your data goes here.];
          B = linspace(min(A),max(A),1000);
          C = interp1 (A,B) % for linear interpolation.. after than u may use plot(C)
Then Try with options..like
          C = interp1(A,B,'spline') % this is not good idea as spline is not defined between two widely spaced points.

and then keep on trying different options.

I hope it helps,
If it is what you require please write back..
I will bee waiting..

Regards,
Faraz


"May " <xrayspectrum@gmail.com> wrote in message <h37q2q$9tp$1@fred.mathworks.com>...
> Hi,
>
> I would like to interpolate these data points by introducing 1000 points between them. I tried with interp1,interp1q and so on but never successful.. At the end of the interpolation, the length should be 1000.
>
> How can i do it.
>
> Thank you.
>
>

Subject: interpolation

From: May

Date: 14 Jul, 2009 09:28:01

Message: 6 of 6

Hi Faraz,

I tried with your proposed solution but I did not get the results what i want. However i found something important in te file exchange (interppolygon) which is able to do exactly what i want. The problem with interppolygon is that it needs all the values to be distinct so that in can interpolate between them. But my data has some similar points. Anyways thanks for your time and suggestions.

best regards

"Faraz Afzal" <farazafzal@gmail.com> wrote in message <h39obv$qe8$1@fred.mathworks.com>...
> Hi...
>
> I dont know if it helps or not.... i tried but lets see what u like..
>
> first of all i must tell u that linear interpolation between 2 points is a process of joining them with a linear straight line.. Now if i see ur data for example take like 11 and -72 and joining them two say with 1000 samll points between them is still a straight line....
> ..
>
> if i go for some spline quadratic or cubic spline interpolation then it would not be define between these two widely spaced points...
>
> anywayz this is what i did.. and u r allowed to play with all possibilities of interp1...
>
> first of all replace all commas with points or MATLAB take is as a separator between two elements..
> then
> format long
> A = [your data goes here.];
> B = linspace(min(A),max(A),1000);
> C = interp1 (A,B) % for linear interpolation.. after than u may use plot(C)
> Then Try with options..like
> C = interp1(A,B,'spline') % this is not good idea as spline is not defined between two widely spaced points.
>
> and then keep on trying different options.
>
> I hope it helps,
> If it is what you require please write back..
> I will bee waiting..
>
> Regards,
> Faraz
>
>
> "May " <xrayspectrum@gmail.com> wrote in message <h37q2q$9tp$1@fred.mathworks.com>...
> > Hi,
> >
> > I would like to interpolate these data points by introducing 1000 points between them. I tried with interp1,interp1q and so on but never successful.. At the end of the interpolation, the length should be 1000.
> >
> > How can i do it.
> >
> > Thank you.
> >
> >

Tags for 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