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

Subject: interpolate

From: maryam

Date: 26 Dec, 2012 18:29:07

Message: 1 of 13

hi dear all
how could I interpolate rows of a matrix so that original value of rows don't change?
thank you very much

Subject: interpolate

From: dpb

Date: 26 Dec, 2012 18:58:17

Message: 2 of 13

On 12/26/2012 12:29 PM, maryam wrote:
...
> how could I interpolate rows of a matrix so that original value of rows
> don't change?

Didn't we do this before the holidays?????

doc interp1

 >> X = 0:10; V = sin(X); Xq = 0:.25:10;
 >> Vq = interp1(X,V,Xq);
 >> all(Vq(Xq==fix(Xq))==V)
ans =
     1
 >>


What else do you need????

--

Subject: interpolate

From: maryam

Date: 26 Dec, 2012 23:03:08

Message: 3 of 13

dpb <none@non.net> wrote in message <kbfhar$1lo$1@speranza.aioe.org>...
> On 12/26/2012 12:29 PM, maryam wrote:
> ...
> > how could I interpolate rows of a matrix so that original value of rows
> > don't change?
>
> Didn't we do this before the holidays?????
>
> doc interp1
>
> >> X = 0:10; V = sin(X); Xq = 0:.25:10;
> >> Vq = interp1(X,V,Xq);
> >> all(Vq(Xq==fix(Xq))==V)
> ans =
> 1
> >>
>
>
> What else do you need????
---------------------------------------------------
This question has already been answered?
I searched but I didn't find it

thank you very much for your answer but I mean we have a matrix n-by-m:
assume M= [a b c;d e f; g h i]
I want to interpolate its rows so that is equal to
M=[a a+d a+2d a+3d ... 7d b b+d ... b+7d c... c+7d ; d... d+7d... f+7d ; g ... i+7d]
Can you explain me how I could do it?
 

Subject: interpolate

From: dpb

Date: 27 Dec, 2012 00:46:57

Message: 4 of 13

On 12/26/2012 5:03 PM, maryam wrote:
> dpb <none@non.net> wrote in message <kbfhar$1lo$1@speranza.aioe.org>...
>> On 12/26/2012 12:29 PM, maryam wrote:
>> ...
>> > how could I interpolate rows of a matrix so that original value of rows
>> > don't change?
>>
>> Didn't we do this before the holidays?????
>>
>> doc interp1
>>
>> >> X = 0:10; V = sin(X); Xq = 0:.25:10;
>> >> Vq = interp1(X,V,Xq);
>> >> all(Vq(Xq==fix(Xq))==V)
>> ans =
>> 1
>> >>
>>
>>
>> What else do you need????
> ---------------------------------------------------
> This question has already been answered?
> I searched but I didn't find it
> thank you very much for your answer but I mean we have a matrix n-by-m:
> assume M= [a b c;d e f; g h i]
> I want to interpolate its rows so that is equal to
> M=[a a+d a+2d a+3d ... 7d b b+d ... b+7d c... c+7d ; d... d+7d... f+7d ;
> g ... i+7d]
> Can you explain me how I could do it?

I'm virtually certain you asked this same question some days ago and I
told you then the same thing...

Use interp1() as the above example w/ an interpolating vector of the
points at which you want interpolants. Here's why I think I remember
the question and the response, as I pointed out then, since interp1()
works on columns you'll need to transpose, interpolate, then transpose back.

I can't interpret the above [a a+d a+2d ... ) precisely but assuming d
here is a different 'd' than that of the value in the original M(2,1)
and is just a delta then the interpolant would seem to be
linspace(0,N*d,N+1) where N is the number of intervals (7 above) added
to a, b, c, ..., etc.

--

Subject: interpolate

From: maryam

Date: 27 Dec, 2012 01:45:09

Message: 5 of 13

dpb <none@non.net> wrote in message <kbg5ol$ugl$1@speranza.aioe.org>...
> On 12/26/2012 5:03 PM, maryam wrote:
> > dpb <none@non.net> wrote in message <kbfhar$1lo$1@speranza.aioe.org>...
> >> On 12/26/2012 12:29 PM, maryam wrote:
> >> ...
> >> > how could I interpolate rows of a matrix so that original value of rows
> >> > don't change?
> >>
> >> Didn't we do this before the holidays?????
> >>
> >> doc interp1
> >>
> >> >> X = 0:10; V = sin(X); Xq = 0:.25:10;
> >> >> Vq = interp1(X,V,Xq);
> >> >> all(Vq(Xq==fix(Xq))==V)
> >> ans =
> >> 1
> >> >>
> >>
> >>
> >> What else do you need????
> > ---------------------------------------------------
> > This question has already been answered?
> > I searched but I didn't find it
> > thank you very much for your answer but I mean we have a matrix n-by-m:
> > assume M= [a b c;d e f; g h i]
> > I want to interpolate its rows so that is equal to
> > M=[a a+d a+2d a+3d ... 7d b b+d ... b+7d c... c+7d ; d... d+7d... f+7d ;
> > g ... i+7d]
> > Can you explain me how I could do it?
>
> I'm virtually certain you asked this same question some days ago and I
> told you then the same thing...
>
> Use interp1() as the above example w/ an interpolating vector of the
> points at which you want interpolants. Here's why I think I remember
> the question and the response, as I pointed out then, since interp1()
> works on columns you'll need to transpose, interpolate, then transpose back.
>
> I can't interpret the above [a a+d a+2d ... ) precisely but assuming d
> here is a different 'd' than that of the value in the original M(2,1)
> and is just a delta then the interpolant would seem to be
> linspace(0,N*d,N+1) where N is the number of intervals (7 above) added
> to a, b, c, ..., etc.
>
> --
------------------------------------
Dear dpb
thank you so much, I'm Beginner in matlab,
I apologize for my request
Is it possible give me matlab code of my question?
I couldn't use 'for' command or M(:,columns) ...
my matrix is 1000-by-1200
d=delta=1/16
its values (arrays) is arbitrary here
thanks for your help

Subject: interpolate

From: dpb

Date: 27 Dec, 2012 15:55:09

Message: 6 of 13

On 12/26/2012 7:45 PM, maryam wrote:
> dpb <none@non.net> wrote in message <kbg5ol$ugl$1@speranza.aioe.org>...
>> On 12/26/2012 5:03 PM, maryam wrote:
>> > dpb <none@non.net> wrote in message <kbfhar$1lo$1@speranza.aioe.org>...
...

>> >> doc interp1
>> >>
>> >> >> X = 0:10; V = sin(X); Xq = 0:.25:10;
>> >> >> Vq = interp1(X,V,Xq);
...

>> > thank you very much for your answer but I mean we have a matrix n-by-m:
>> > assume M= [a b c;d e f; g h i]
>> > I want to interpolate its rows so that is equal to
>> > M=[a a+d a+2d a+3d ... 7d b b+d ... b+7d c... c+7d ; d... d+7d...
>> f+7d ;
>> > g ... i+7d]
>> > Can you explain me how I could do it?
>>
>> I'm virtually certain you asked this same question some days ago and I
>> told you then the same thing...
>>
>> Use interp1() as the above example w/ an interpolating vector of the
>> points at which you want interpolants. Here's why I think I remember
>> the question and the response, as I pointed out then, since interp1()
>> works on columns you'll need to transpose, interpolate, then transpose
>> back.
>>
>> I can't interpret the above [a a+d a+2d ... ) precisely but assuming d
>> here is a different 'd' than that of the value in the original M(2,1)
>> and is just a delta then the interpolant would seem to be
>> linspace(0,N*d,N+1) where N is the number of intervals (7 above) added
>> to a, b, c, ..., etc.
>>
...

> thank you so much, I'm Beginner in matlab,
> I apologize for my request
> Is it possible give me matlab code of my question?
> I couldn't use 'for' command or M(:,columns) ...
> my matrix is 1000-by-1200 d=delta=1/16
> its values (arrays) is arbitrary here

That's identical to the example I gave except on an array instead of a
vector...and a still-to-be-determined precisely interpolant.

What does the 1/16 delta refer to--is it a constant or a fraction of the
distance between columns, or what? Your description isn't precise (or
at least I can't decipher what it is you want clearly enough to actually
write a piece of specific code).

Can you give a very small example of a dataset that you could compute
the desired result of by hand? It wouldn't have to be but one row and a
few values to illustrate what you're actually trying to do...

--

Subject: interpolate

From: maryam

Date: 28 Dec, 2012 17:00:09

Message: 7 of 13

dpb <none@non.net> wrote in message <kbhqvf$l2s$1@speranza.aioe.org>...
> On 12/26/2012 7:45 PM, maryam wrote:
> > dpb <none@non.net> wrote in message <kbg5ol$ugl$1@speranza.aioe.org>...
> >> On 12/26/2012 5:03 PM, maryam wrote:
> >> > dpb <none@non.net> wrote in message <kbfhar$1lo$1@speranza.aioe.org>...
> ...
>
> >> >> doc interp1
> >> >>
> >> >> >> X = 0:10; V = sin(X); Xq = 0:.25:10;
> >> >> >> Vq = interp1(X,V,Xq);
> ...
>
> >> > thank you very much for your answer but I mean we have a matrix n-by-m:
> >> > assume M= [a b c;d e f; g h i]
> >> > I want to interpolate its rows so that is equal to
> >> > M=[a a+d a+2d a+3d ... 7d b b+d ... b+7d c... c+7d ; d... d+7d...
> >> f+7d ;
> >> > g ... i+7d]
> >> > Can you explain me how I could do it?
> >>
> >> I'm virtually certain you asked this same question some days ago and I
> >> told you then the same thing...
> >>
> >> Use interp1() as the above example w/ an interpolating vector of the
> >> points at which you want interpolants. Here's why I think I remember
> >> the question and the response, as I pointed out then, since interp1()
> >> works on columns you'll need to transpose, interpolate, then transpose
> >> back.
> >>
> >> I can't interpret the above [a a+d a+2d ... ) precisely but assuming d
> >> here is a different 'd' than that of the value in the original M(2,1)
> >> and is just a delta then the interpolant would seem to be
> >> linspace(0,N*d,N+1) where N is the number of intervals (7 above) added
> >> to a, b, c, ..., etc.
> >>
> ...
>
> > thank you so much, I'm Beginner in matlab,
> > I apologize for my request
> > Is it possible give me matlab code of my question?
> > I couldn't use 'for' command or M(:,columns) ...
> > my matrix is 1000-by-1200 d=delta=1/16
> > its values (arrays) is arbitrary here
>
> That's identical to the example I gave except on an array instead of a
> vector...and a still-to-be-determined precisely interpolant.
>
> What does the 1/16 delta refer to--is it a constant or a fraction of the
> distance between columns, or what? Your description isn't precise (or
> at least I can't decipher what it is you want clearly enough to actually
> write a piece of specific code).
>
> Can you give a very small example of a dataset that you could compute
> the desired result of by hand? It wouldn't have to be but one row and a
> few values to illustrate what you're actually trying to do...
>
-------------------------------------------------------
Hi thank you so much for your reply
Here is a simple code, that Matlab wouldn’t run it:

ti=1.44e-4; to=1.48e-04; dt=1e-9;
m=2*ceil(.5*(to-ti)/dt);
n=linspace(0,2,600);
t=ti+(0:m-1)*dt;
s=zeros(600,m);
for k=1:600
        s(k,:)=exp(i*2*pi*10e5*sqrt(3*n(k))+i*pi*t.^2);
end
s1=s;
d=(10-n).^2/8;
for k=1:600;
    for r=1:m-round(max(d));
        s1(k,m)=s(k,m+d(k));
    end
end

each d vector element like d(1)=12.5 includes an integer part(12) and a fractional one(0.5).
I need an interpolator to move the data an arbitrary fraction of the space between each 2 elements, this fraction is quantized to 1/16 of the space between 2 elements, so 15 different interpolators are needed to move the data by i /16 of this space, where i = 1 : 15, A simple interpolator is obtained from a truncated sinc function that the coefficients are weighted by a window like kaiser.

I didn’t know how to round d vector?
And how could I interpolate rows of s matrix?

I would really appreciate your kind help

Subject: interpolate

From: maryam

Date: 28 Dec, 2012 17:01:06

Message: 8 of 13

dpb <none@non.net> wrote in message <kbhqvf$l2s$1@speranza.aioe.org>...
> On 12/26/2012 7:45 PM, maryam wrote:
> > dpb <none@non.net> wrote in message <kbg5ol$ugl$1@speranza.aioe.org>...
> >> On 12/26/2012 5:03 PM, maryam wrote:
> >> > dpb <none@non.net> wrote in message <kbfhar$1lo$1@speranza.aioe.org>...
> ...
>
> >> >> doc interp1
> >> >>
> >> >> >> X = 0:10; V = sin(X); Xq = 0:.25:10;
> >> >> >> Vq = interp1(X,V,Xq);
> ...
>
> >> > thank you very much for your answer but I mean we have a matrix n-by-m:
> >> > assume M= [a b c;d e f; g h i]
> >> > I want to interpolate its rows so that is equal to
> >> > M=[a a+d a+2d a+3d ... 7d b b+d ... b+7d c... c+7d ; d... d+7d...
> >> f+7d ;
> >> > g ... i+7d]
> >> > Can you explain me how I could do it?
> >>
> >> I'm virtually certain you asked this same question some days ago and I
> >> told you then the same thing...
> >>
> >> Use interp1() as the above example w/ an interpolating vector of the
> >> points at which you want interpolants. Here's why I think I remember
> >> the question and the response, as I pointed out then, since interp1()
> >> works on columns you'll need to transpose, interpolate, then transpose
> >> back.
> >>
> >> I can't interpret the above [a a+d a+2d ... ) precisely but assuming d
> >> here is a different 'd' than that of the value in the original M(2,1)
> >> and is just a delta then the interpolant would seem to be
> >> linspace(0,N*d,N+1) where N is the number of intervals (7 above) added
> >> to a, b, c, ..., etc.
> >>
> ...
>
> > thank you so much, I'm Beginner in matlab,
> > I apologize for my request
> > Is it possible give me matlab code of my question?
> > I couldn't use 'for' command or M(:,columns) ...
> > my matrix is 1000-by-1200 d=delta=1/16
> > its values (arrays) is arbitrary here
>
> That's identical to the example I gave except on an array instead of a
> vector...and a still-to-be-determined precisely interpolant.
>
> What does the 1/16 delta refer to--is it a constant or a fraction of the
> distance between columns, or what? Your description isn't precise (or
> at least I can't decipher what it is you want clearly enough to actually
> write a piece of specific code).
>
> Can you give a very small example of a dataset that you could compute
> the desired result of by hand? It wouldn't have to be but one row and a
> few values to illustrate what you're actually trying to do...
>
-------------------------------------------------------
Hi thank you so much for your reply
Here is a simple code, that Matlab wouldn’t run it:

ti=1.44e-4; to=1.48e-04; dt=1e-9;
m=2*ceil(.5*(to-ti)/dt);
n=linspace(0,2,600);
t=ti+(0:m-1)*dt;
s=zeros(600,m);
for k=1:600
        s(k,:)=exp(i*2*pi*10e5*sqrt(3*n(k))+i*pi*t.^2);
end
s1=s;
d=(10-n).^2/8;
for k=1:600;
    for r=1:m-round(max(d));
        s1(k,m)=s(k,m+d(k));
    end
end

each d vector element like d(1)=12.5 includes an integer part(12) and a fractional one(0.5).
I need an interpolator to move the data an arbitrary fraction of the space between each 2 elements, this fraction is quantized to 1/16 of the space between 2 elements, so 15 different interpolators are needed to move the data by i /16 of this space, where i = 1 : 15, A simple interpolator is obtained from a truncated sinc function that the coefficients are weighted by a window like kaiser.

I didn’t know how to round d vector?
And how could I interpolate rows of s matrix?

I would really appreciate your kind help

Subject: interpolate

From: maryam

Date: 28 Dec, 2012 21:35:08

Message: 9 of 13

"maryam" wrote in message <kbkj8i$i6n$1@newscl01ah.mathworks.com>...
> dpb <none@non.net> wrote in message <kbhqvf$l2s$1@speranza.aioe.org>...
> > On 12/26/2012 7:45 PM, maryam wrote:
> > > dpb <none@non.net> wrote in message <kbg5ol$ugl$1@speranza.aioe.org>...
> > >> On 12/26/2012 5:03 PM, maryam wrote:
> > >> > dpb <none@non.net> wrote in message <kbfhar$1lo$1@speranza.aioe.org>...
> > ...
> >
> > >> >> doc interp1
> > >> >>
> > >> >> >> X = 0:10; V = sin(X); Xq = 0:.25:10;
> > >> >> >> Vq = interp1(X,V,Xq);
> > ...
> >
> > >> > thank you very much for your answer but I mean we have a matrix n-by-m:
> > >> > assume M= [a b c;d e f; g h i]
> > >> > I want to interpolate its rows so that is equal to
> > >> > M=[a a+d a+2d a+3d ... 7d b b+d ... b+7d c... c+7d ; d... d+7d...
> > >> f+7d ;
> > >> > g ... i+7d]
> > >> > Can you explain me how I could do it?
> > >>
> > >> I'm virtually certain you asked this same question some days ago and I
> > >> told you then the same thing...
> > >>
> > >> Use interp1() as the above example w/ an interpolating vector of the
> > >> points at which you want interpolants. Here's why I think I remember
> > >> the question and the response, as I pointed out then, since interp1()
> > >> works on columns you'll need to transpose, interpolate, then transpose
> > >> back.
> > >>
> > >> I can't interpret the above [a a+d a+2d ... ) precisely but assuming d
> > >> here is a different 'd' than that of the value in the original M(2,1)
> > >> and is just a delta then the interpolant would seem to be
> > >> linspace(0,N*d,N+1) where N is the number of intervals (7 above) added
> > >> to a, b, c, ..., etc.
> > >>
> > ...
> >
> > > thank you so much, I'm Beginner in matlab,
> > > I apologize for my request
> > > Is it possible give me matlab code of my question?
> > > I couldn't use 'for' command or M(:,columns) ...
> > > my matrix is 1000-by-1200 d=delta=1/16
> > > its values (arrays) is arbitrary here
> >
> > That's identical to the example I gave except on an array instead of a
> > vector...and a still-to-be-determined precisely interpolant.
> >
> > What does the 1/16 delta refer to--is it a constant or a fraction of the
> > distance between columns, or what? Your description isn't precise (or
> > at least I can't decipher what it is you want clearly enough to actually
> > write a piece of specific code).
> >
> > Can you give a very small example of a dataset that you could compute
> > the desired result of by hand? It wouldn't have to be but one row and a
> > few values to illustrate what you're actually trying to do...
> >
> -------------------------------------------------------
> Hi thank you so much for your reply
> Here is a simple code, that Matlab wouldn’t run it:
>
> ti=1.44e-4; to=1.48e-04; dt=1e-9;
> m=2*ceil(.5*(to-ti)/dt);
> n=linspace(0,2,600);
> t=ti+(0:m-1)*dt;
> s=zeros(600,m);
> for k=1:600
> s(k,:)=exp(i*2*pi*10e5*sqrt(3*n(k))+i*pi*t.^2);
> end
> s1=s;
> d=(10-n).^2/8;
> for k=1:600;
> for r=1:m-round(max(d));
> s1(k,m)=s(k,m+d(k));
> end
> end
>
> each d vector element like d(1)=12.5 includes an integer part(12) and a fractional one(0.5).
> I need an interpolator to move the data an arbitrary fraction of the space between each 2 elements, this fraction is quantized to 1/16 of the space between 2 elements, so 15 different interpolators are needed to move the data by i /16 of this space, where i = 1 : 15, A simple interpolator is obtained from a truncated sinc function that the coefficients are weighted by a window like kaiser.
>
> I didn’t know how to round d vector?
> And how could I interpolate rows of s matrix?
>
> I would really appreciate your kind help
------------------
One thing I forgot, after interpolation we shift its value to nearest element

Subject: interpolate

From: dpb

Date: 28 Dec, 2012 22:07:35

Message: 10 of 13

On 12/28/2012 3:35 PM, maryam wrote:
...

>> Here is a simple code, that Matlab wouldn’t run it:
>>
...

>> I didn’t know how to round d vector?
>> And how could I interpolate rows of s matrix?
>>
>> I would really appreciate your kind help
> ------------------
> One thing I forgot, after interpolation we shift its value to nearest
> element

This is getting more, not less confusing all the time...I have no idea
what the last is intended...

Again, give a _small_ dataset and a desired result and a rule for how
you got the result from the input. Giving non-working code for an
ill-specified problem is of no help in explaining a desired algorithm.

--

Subject: interpolate

From: Steven_Lord

Date: 31 Dec, 2012 04:49:07

Message: 11 of 13



"dpb" <none@non.net> wrote in message news:kbl55f$d1g$1@speranza.aioe.org...
> On 12/28/2012 3:35 PM, maryam wrote:
> ...
>
>>> Here is a simple code, that Matlab wouldnt run it:
>>>
> ...
>
>>> I didnt know how to round d vector?
>>> And how could I interpolate rows of s matrix?
>>>
>>> I would really appreciate your kind help
>> ------------------
>> One thing I forgot, after interpolation we shift its value to nearest
>> element
>
> This is getting more, not less confusing all the time...I have no idea
> what the last is intended...
>
> Again, give a _small_ dataset and a desired result and a rule for how you
> got the result from the input. Giving non-working code for an
> ill-specified problem is of no help in explaining a desired algorithm.

I'm going to make dpb's request more specific. For this specific matrix:

A = [1, 2, 4; 7, 12, 22; 8, 19, 45]

What EXACTLY do you want the result of the interpolation you described to
be? If possible also show the steps/calculations you'd perform to obtain
that result if you had to perform the interpolation using pencil and paper.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: interpolate

From: maryam

Date: 31 Dec, 2012 10:20:22

Message: 12 of 13

"Steven_Lord" <slord@mathworks.com> wrote in message <kbr5g3$26g$1@newscl01ah.mathworks.com>...
>
>
> "dpb" <none@non.net> wrote in message news:kbl55f$d1g$1@speranza.aioe.org...
> > On 12/28/2012 3:35 PM, maryam wrote:
> > ...
> >
> >>> Here is a simple code, that Matlab wouldnt run it:
> >>>
> > ...
> >
> >>> I didnt know how to round d vector?
> >>> And how could I interpolate rows of s matrix?
> >>>
> >>> I would really appreciate your kind help
> >> ------------------
> >> One thing I forgot, after interpolation we shift its value to nearest
> >> element
> >
> > This is getting more, not less confusing all the time...I have no idea
> > what the last is intended...
> >
> > Again, give a _small_ dataset and a desired result and a rule for how you
> > got the result from the input. Giving non-working code for an
> > ill-specified problem is of no help in explaining a desired algorithm.
>
> I'm going to make dpb's request more specific. For this specific matrix:
>
> A = [1, 2, 4; 7, 12, 22; 8, 19, 45]
>
> What EXACTLY do you want the result of the interpolation you described to
> be? If possible also show the steps/calculations you'd perform to obtain
> that result if you had to perform the interpolation using pencil and paper.
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com
---------------------------
thanks a lot for your reply
 A = [1, 2, 4; 7, 12, 22; 8, 19, 45; 50 -1+j 3 0] & d = [1.1718 +0.7365 -1.6971 -0.9855]
I want to add elements of d to A indices:
b=[A(1,1+1.1718) A(1,2+1.1718) A(1,3+1.1718);
     A(2,1+0.7365) A(2,2+0.7365) A(2,3+0.7365);
     A(3,1-1.6971) A(3,2-1.6971) A(3,3-1.6971);
      A(4,1-0.9855) A(4,2-0.9855) A(4,3-0.9855)]
as is clear d elements aren't integer, I want the distance between two A elements divided into sixteen parts and is interpolated using truncated sinc.
after interpolation the values is shifted to nearest neighborhood
I mean b(2,2)=A(2,2.7365)=c(2,3) & b(1,1)=A(1,1.1718)=c(1,1)

best regards

Subject: interpolate

From: dpb

Date: 31 Dec, 2012 14:33:47

Message: 13 of 13

On 12/31/2012 4:20 AM, maryam wrote:
...

> thanks a lot for your reply
> A = [1, 2, 4; 7, 12, 22; 8, 19, 45; 50 -1+j 3 0] & d = [1.1718 +0.7365
> -1.6971 -0.9855]
> I want to add elements of d to A indices:
> b=[A(1,1+1.1718) A(1,2+1.1718) A(1,3+1.1718);
> A(2,1+0.7365) A(2,2+0.7365) A(2,3+0.7365);
> A(3,1-1.6971) A(3,2-1.6971) A(3,3-1.6971);
> A(4,1-0.9855) A(4,2-0.9855) A(4,3-0.9855)]
> as is clear d elements aren't integer, I want the distance between two A
> elements divided into sixteen parts and is interpolated using truncated
> sinc.
> after interpolation the values is shifted to nearest neighborhood I mean
> b(2,2)=A(2,2.7365)=c(2,3) & b(1,1)=A(1,1.1718)=c(1,1)

 >> ix=round(repmat([1:length(d)],4,1)+repmat(d',1,length(d)))
ix =
      2 3 4 5
      2 3 4 5
     -1 0 1 2
      0 1 2 3
 >>

is your rounded index array, do w/ it what you will...I've still no idea
what it is you're really trying to do as again you haven't followed the
seemingly simple request to work through an example as if you were doing
it on paper, step-by-step, not assuming the reader knows anything
_except_ what you write.

--

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