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:
problem with mesh

Subject: problem with mesh

From: Varun Nalam

Date: 27 May, 2011 11:49:05

Message: 1 of 2

i am doing a project where i need to process different images and plot the highest intensity points.

for that i defined x as the number of images (which are 250),y as 640(as the image is 640 by 480)and scan all the 480 pixels for a given y and note it as v(y,x)=the other coordinate of the pixel(one of them is y)

now,while plotting a mesh,when i use the following command,
mesh(v);
i get a mesh.

but in case i use the following command

[x]=meshgrid(1:1:250);
[y]=meshgrid(1:1:600);

z=v(x,y);


mesh(x,y,z);

but as soon as i write the third command,an error is displayed which says given value exceeds matrix dimensions.

Can u please tell me why im getting the error and how i could avoid it?

Thanks a lot

Subject: problem with mesh

From: Sadik

Date: 28 May, 2011 17:53:02

Message: 2 of 2

Hi Varun,

You should instead use something like this:

[X,Y] = meshgrid(1:250,1:600);
meshgrid(X,Y,v);

Best.

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