http://www.mathworks.com/matlabcentral/newsreader/view_thread/308388
MATLAB Central Newsreader  problem with mesh
Feed for thread: problem with mesh
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Fri, 27 May 2011 11:49:05 +0000
problem with mesh
http://www.mathworks.com/matlabcentral/newsreader/view_thread/308388#838204
Varun Nalam
i am doing a project where i need to process different images and plot the highest intensity points.<br>
<br>
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)<br>
<br>
now,while plotting a mesh,when i use the following command,<br>
mesh(v);<br>
i get a mesh.<br>
<br>
but in case i use the following command<br>
<br>
[x]=meshgrid(1:1:250);<br>
[y]=meshgrid(1:1:600);<br>
<br>
z=v(x,y);<br>
<br>
<br>
mesh(x,y,z);<br>
<br>
but as soon as i write the third command,an error is displayed which says given value exceeds matrix dimensions.<br>
<br>
Can u please tell me why im getting the error and how i could avoid it?<br>
<br>
Thanks a lot

Sat, 28 May 2011 17:53:02 +0000
Re: problem with mesh
http://www.mathworks.com/matlabcentral/newsreader/view_thread/308388#838346
Sadik
Hi Varun,<br>
<br>
You should instead use something like this:<br>
<br>
[X,Y] = meshgrid(1:250,1:600);<br>
meshgrid(X,Y,v);<br>
<br>
Best.