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:
reordering data for contour (gridding ordered data)

Subject: reordering data for contour (gridding ordered data)

From: Allen

Date: 13 Oct, 2005 02:00:06

Message: 1 of 3

Hi everyone on C.SS.Matlab!

I have a new question which you may be able to help me answer quickly. I
have data in the form (X, Y, Z) coming from the earlier discussion of
pol2cart (thanks for pointing out my improper use of it)... my question
now stems from my attempts to plot contour plots of the data.

My understanding of contour is that needs x,y,z where z is greater than
2x2. Now, my earlier data is in a format x1,y1,z1 and down the line
(nx3 matrix). The data is regular (it was taken on a cylindrical grid
which I suspect will come out properly in x,y as gridded, but haven't
checked on this- actually, it might not be in cartesian... oh well)...
But the general question of ordering data came up for me in regards to
this current problem.

Is there a good way to reorganize data so that it's compatible with
contour, if you have an nx3 (X, Y, Z) matrix of ordered data points? Is
interpolation required? Since it's gridded already, but not in an MxN
matrix for each x and y and z, is reshaping only required? Or, is
ordering of each matrix- say x and y, also required?

Does contour require the data to be organized in an increasing x and y
format?

Thank you for your thoughts and help! My best regards!
-Allen

Subject: reordering data for contour (gridding ordered data)

From: Tiga

Date: 13 Oct, 2005 10:24:15

Message: 2 of 3

Hi Allen,

for a contour plot you need three matrices that have the same size.
The syntax is the same as for 'mesh'. I would adivse to study the
Matlab Help for 'griddata', because you can find an excellent example
there.

Tiga

Subject: reordering data for contour (gridding ordered data)

From: Allen

Date: 13 Oct, 2005 13:10:59

Message: 3 of 3

Tiga wrote:
> Hi Allen,
>
> for a contour plot you need three matrices that have the same size.
> The syntax is the same as for 'mesh'. I would adivse to study the
> Matlab Help for 'griddata', because you can find an excellent example
> there.
>
> Tiga

Hi Tiga,

Thank you for your reply to my question, I greatly appreciate your thoughts.

The reason I'm asking this is for *ordered* data. i.e., data which is
already in a grid-like fashion albeit, a 1-d grid (line). I'm wondering
if the data, being already equally spaced, only needs to be reshaped
before use of a routine like contour which expects grid-data. OR, does
it need to be sequentially ordered in x and y as well as reshaped?

My inherent problem with grid-data is it *appears* to interpolate. Am I
wrong on this? In other words, is there a non-interpolation mode which
would reorganize and reshape my data appropriately?

Thank you for your thoughts!!
-Allen

--
------
a.s.p. Brother of the Briar, May 2001
http://tobaccocellar.org/tinlist.php?cellar=119

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