Thread Subject: 3D Mapping

Subject: 3D Mapping

From: Alicia Sanchez

Date: 1 Jun, 2006 16:11:05

Message: 1 of 5

I need to plot a figure more or less like the one showed in the "surf
function". My problem is that I have 3 vectors of size Nx1, that
indicate the x and y coordinates, and the other one the power value
associated to that point (x,y).

My problem is that I need to make some interpolation with the values
that I have, in order to construct the surface to be respresented. In
this picture is shown more or less the values that I've got. The x´s
represents a different value. So i need to cover the holes in between
them, so I can draw a surface where the height (or color) indicates
the value of the power.
Any of you know how to solve this problem?

|
| x x
| x x x x x x
|xx x x x x x x
|xx x x
|x x x x x x x
|_________________________

Subject: 3D Mapping

From: Perry

Date: 1 Jun, 2006 16:29:45

Message: 2 of 5

If you need to fill the gaps in the third array (the power values)
may I suggest 2 loops :

For y = 1:n
%=========================================
% Outer loop control, for n rows
%=========================================
For x = 1:n
%=========================================
% Inner loop control, for n columns. I'm assuming you have as many
columns as rows, and I assume an empty value is simply a [] in the
power vector.
%=========================================

if isempty(power_vector(y,x))
%==========================================
% Perform some interpolation action
% Example as below, but this assumes you no not have empty entries
side by side !!
%===========================================

switch x
 case {1,n}
 %==================================================
 % If beginning of end of row then cannot average between next higher
and lower columns
%==========================================================
    if x == 1
         power_vector(y,x) = power_vector(y,x+1); % As example fill
with next higher value
    else
         power_vector(y,x) = power_vector(y,x-1);
    end

otherwise
%===========================================
% Average next higher and lower power values
%===========================================

power_vector(y,x) =(power_vector(y,x+1)...
 + power_vector(y,x-1))/2

end

end

end

 Alicia Sanchez wrote:
>
>
> I need to plot a figure more or less like the one showed in the
> "surf
> function". My problem is that I have 3 vectors of size Nx1, that
> indicate the x and y coordinates, and the other one the power value
> associated to that point (x,y).
>
> My problem is that I need to make some interpolation with the
> values
> that I have, in order to construct the surface to be respresented.
> In
> this picture is shown more or less the values that I've got. The
> x´s
> represents a different value. So i need to cover the holes in
> between
> them, so I can draw a surface where the height (or color) indicates
> the value of the power.
> Any of you know how to solve this problem?
>
> |
> | x x
> | x x x x x x
> |xx x x x x x x
> |xx x x
> |x x x x x x x
> |_________________________

Subject: 3D Mapping

From: CRet

Date: 2 Jun, 2006 00:01:25

Message: 3 of 5

"Perry" <reply@board.thanks> wrote in
news:ef386c5.0@webcrossing.raydaftYaTP...
[skip]
>
> if isempty(power_vector(y,x))
>
[skip]

"Alicia Sanchez" <aliciasmm82@gmail.com> wrote in
news:ef386c5.-1@webcrossing.raydaftYaTP...
> I need to plot a figure more or less like the one showed in the "surf
function".
> My problem is that I have 3 vectors of size Nx1,

Sorry Perry, but your "power_vector" matrice not correspond to the initial
condition indicate by Alicia.

C.Ret


Subject: 3D Mapping

From: CRet

Date: 2 Jun, 2006 00:33:26

Message: 4 of 5

Dear Akicia,

look at the doc griddata and the exemple.

Hope this help you.
C.Ret


"Alicia Sanchez" <aliciasmm82@gmail.com> wrote in
news:ef386c5.-1@webcrossing.raydaftYaTP...
> I need to plot a figure more or less like the one showed in the "surf
> function". My problem is that I have 3 vectors of size Nx1, that
> indicate the x and y coordinates, and the other one the power value
> associated to that point (x,y).
>
> My problem is that I need to make some interpolation with the values
> that I have, in order to construct the surface to be respresented. In
> this picture is shown more or less the values that I've got. The x´s
> represents a different value. So i need to cover the holes in between
> them, so I can draw a surface where the height (or color) indicates
> the value of the power.
> Any of you know how to solve this problem?
>
> |
> | x x
> | x x x x x x
> |xx x x x x x x
> |xx x x
> |x x x x x x x
> |_________________________


Subject: 3D Mapping

From: Perry

Date: 2 Jun, 2006 04:52:04

Message: 5 of 5

CRet,

You're right ! Utter rubbish I wrote. I blame it on me responding
late at night.

Sorry Alicia !

 CRet wrote:
>
>
> Dear Akicia,
>
> look at the doc griddata and the exemple.
>
> Hope this help you.
> C.Ret
>
>
> "Alicia Sanchez" <aliciasmm82@gmail.com> wrote in
> news:ef386c5.-1@webcrossing.raydaftYaTP...
>> I need to plot a figure more or less like the one showed in the
> "surf
>> function". My problem is that I have 3 vectors of size Nx1,
that
>> indicate the x and y coordinates, and the other one the power
> value
>> associated to that point (x,y).
>>
>> My problem is that I need to make some interpolation with the
> values
>> that I have, in order to construct the surface to be
> respresented. In
>> this picture is shown more or less the values that I've got.
The
> x´s
>> represents a different value. So i need to cover the holes in
> between
>> them, so I can draw a surface where the height (or color)
> indicates
>> the value of the power.
>> Any of you know how to solve this problem?
>>
>> |
>> | x x
>> | x x x x x x
>> |xx x x x x x x
>> |xx x x
>> |x x x x x x x
>> |_________________________
>
>
>

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com