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

Subject: understanding interpolation?

From: nman2084

Date: 26 Dec, 2011 23:26:08

Message: 1 of 7

I am not understanding interpolation method like the one I am using inpaint nans:

Start with I have x y z data of a ground surface, but there is are some holes in that data. So i created a meshgrid of that data and used inpaint nans (file exchange function), it filed those holes, but all i wanted is to fill the holes in original data not a meshgrid which has size limitation. how do i use meshgrid to create more x y z to add to data so that i can get a full surface of the ground.

Subject: understanding interpolation?

From: John D'Errico

Date: 27 Dec, 2011 00:01:09

Message: 2 of 7

"nman2084" wrote in message <jdavqg$s6$1@newscl01ah.mathworks.com>...
> I am not understanding interpolation method like the one I am using inpaint nans:
>
> Start with I have x y z data of a ground surface, but there is are some holes in that data. So i created a meshgrid of that data and used inpaint nans (file exchange function), it filed those holes, but all i wanted is to fill the holes in original data not a meshgrid which has size limitation. how do i use meshgrid to create more x y z to add to data so that i can get a full surface of the ground.

You have scattered data (x,y,z) ?

Then don't use inpaint_nans. Use gridfit instead.

Use inpaint_nans when you actually have data in an array
with missing (NaN) elements in the array that are to be
replaced with interpolated values.

If this does not answer your question, then you need to
be more clear about your problem. Or perhaps someone
else can resolve the issue.

John

Subject: understanding interpolation?

From: nman2084

Date: 27 Dec, 2011 03:12:08

Message: 3 of 7

Thanks, i have a question regarding the gridfit, i have xyz scatter data, how do i make xnode and ynode (two arguments in the gridfiit function) do i need to use linspace or do i need to create a meshgrid?





"John D'Errico" <woodchips@rochester.rr.com> wrote in message <jdb1s5$6jh$1@newscl01ah.mathworks.com>...
> "nman2084" wrote in message <jdavqg$s6$1@newscl01ah.mathworks.com>...
> > I am not understanding interpolation method like the one I am using inpaint nans:
> >
> > Start with I have x y z data of a ground surface, but there is are some holes in that data. So i created a meshgrid of that data and used inpaint nans (file exchange function), it filed those holes, but all i wanted is to fill the holes in original data not a meshgrid which has size limitation. how do i use meshgrid to create more x y z to add to data so that i can get a full surface of the ground.
>
> You have scattered data (x,y,z) ?
>
> Then don't use inpaint_nans. Use gridfit instead.
>
> Use inpaint_nans when you actually have data in an array
> with missing (NaN) elements in the array that are to be
> replaced with interpolated values.
>
> If this does not answer your question, then you need to
> be more clear about your problem. Or perhaps someone
> else can resolve the issue.
>
> John

Subject: understanding interpolation?

From: John D'Errico

Date: 27 Dec, 2011 03:33:08

Message: 4 of 7

"nman2084" wrote in message <jdbd28$7jv$1@newscl01ah.mathworks.com>...
> Thanks, i have a question regarding the gridfit, i have xyz scatter data, how do i make xnode and ynode (two arguments in the gridfiit function) do i need to use linspace or do i need to create a meshgrid?
>

linspace will suffice.

John

Subject: understanding interpolation?

From: nman2084

Date: 27 Dec, 2011 16:04:08

Message: 5 of 7

After i get matrices from using gridfit, i would like go back to scattered data but also want to fill the gaps in the data. Gaps here don't contain NaN, but when i plot scattered data there is white space between.




"John D'Errico" <woodchips@rochester.rr.com> wrote in message <jdbe9k$aui$1@newscl01ah.mathworks.com>...
> "nman2084" wrote in message <jdbd28$7jv$1@newscl01ah.mathworks.com>...
> > Thanks, i have a question regarding the gridfit, i have xyz scatter data, how do i make xnode and ynode (two arguments in the gridfiit function) do i need to use linspace or do i need to create a meshgrid?
> >
>
> linspace will suffice.
>
> John

Subject: understanding interpolation?

From: John D'Errico

Date: 27 Dec, 2011 16:21:08

Message: 6 of 7

"nman2084" wrote in message <jdcq9o$jhn$1@newscl01ah.mathworks.com>...
> After i get matrices from using gridfit, i would like go back to scattered data but also want to fill the gaps in the data. Gaps here don't contain NaN, but when i plot scattered data there is white space between.
>

I'm sorry, but this is meaningless as a goal statement.

If you want scattered data with NO gaps in it - that is
mathematically impossible. Scattered data has holes in
it by definition. There are infinitely many other real
numbers between any pair of numbers. And of course,
there are infinitely many points in the plane in any hole
you choose. You cannot have scattered data without
gaps.

My guess is you may be looking for a surface plot that
is only defined over the (possibly concave) domain of
your data. This is a VERY different problem, and an
unstated one, that will require different tools.

Or, you may actually be looking for the functional form
of that surface as a model. Again, an unstated, very
different problem, that will again require a different set
of tools.

The crystal ball is foggy.

John

Subject: understanding interpolation?

From: nman2084

Date: 27 Dec, 2011 18:24:08

Message: 7 of 7

Sorry for the misunderstanding i actually wanted to cut cross-sections from the data if i cut from original data cross-sections will be missing parts, is this possible to use the grid created to get better cross-sections.

     

               

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <jdcr9k$mon$1@newscl01ah.mathworks.com>...
> "nman2084" wrote in message <jdcq9o$jhn$1@newscl01ah.mathworks.com>...
> > After i get matrices from using gridfit, i would like go back to scattered data but also want to fill the gaps in the data. Gaps here don't contain NaN, but when i plot scattered data there is white space between.
> >
>
> I'm sorry, but this is meaningless as a goal statement.
>
> If you want scattered data with NO gaps in it - that is
> mathematically impossible. Scattered data has holes in
> it by definition. There are infinitely many other real
> numbers between any pair of numbers. And of course,
> there are infinitely many points in the plane in any hole
> you choose. You cannot have scattered data without
> gaps.
>
> My guess is you may be looking for a surface plot that
> is only defined over the (possibly concave) domain of
> your data. This is a VERY different problem, and an
> unstated one, that will require different tools.
>
> Or, you may actually be looking for the functional form
> of that surface as a model. Again, an unstated, very
> different problem, that will again require a different set
> of tools.
>
> The crystal ball is foggy.
>
> John

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