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:
Plotting data with nonuniform mesh/grid?

Subject: Plotting data with nonuniform mesh/grid?

From: Christian Koch

Date: 19 Mar, 2010 18:26:08

Message: 1 of 4

Hi, I have a Problem. Im new to Matlab and have to solve a Problem:

I have a matrix with Data 354x350.

The axes are nonlinear x_axis 354x1 and nonlineary y-axis 350x1. I can plot the data but the Image is warped because it shows only evenly spaced axis.

Some Ideas anyone? I would really appreciate it.

Best regards.

Subject: Plotting data with nonuniform mesh/grid?

From: Sadik

Date: 19 Mar, 2010 23:40:08

Message: 2 of 4

Hi Christian,

You can use

imagesc(x,y,Data)

after defining your non-linear vectors x and y.

Best.

Subject: Plotting data with nonuniform mesh/grid?

From: Christian Koch

Date: 20 Mar, 2010 11:31:03

Message: 3 of 4

"Sadik " <sadik.hava@gmail.com> wrote in message <ho120o$smj$1@fred.mathworks.com>...
> Hi Christian,
>
> You can use
>
> imagesc(x,y,Data)
>
> after defining your non-linear vectors x and y.
>
> Best.

Thank you for the answer but the image is still warped, plotting with mesh() works but I somehow need to transfer the data to a regular grid.

Subject: Plotting data with nonuniform mesh/grid?

From: ErasmusMC

Date: 2 Aug, 2010 17:24:27

Message: 4 of 4

"Christian Koch" <christian.koch@abwesend.de> wrote in message <ho2bln$2ha$1@fred.mathworks.com>...
> "Sadik " <sadik.hava@gmail.com> wrote in message <ho120o$smj$1@fred.mathworks.com>...
> > Hi Christian,
> >
> > You can use
> >
> > imagesc(x,y,Data)
> >
> > after defining your non-linear vectors x and y.
> >
> > Best.
>
> Thank you for the answer but the image is still warped, plotting with mesh() works but I somehow need to transfer the data to a regular grid.

If I understand the problem correctly this is what you need:

pcolor(x,y,Data)

Beware:you probably will have to change your x y coordinates to the "node" of the data (in between the coordinates where the data is defined).

Regards

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