MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

### Discover what MATLAB® can do for your career.

 Subject: plotting problem From: Surafel Date: 21 Jul, 2012 22:25:17 Message: 1 of 3 I was trying to plot a graph as follows: [x,y]=meshgrid(-5.12:0.01:5.12); z=round(x)+round(y); meshc(z) the problem is that it plots the graph on the axis for x and y from 0 to 1200, i cant spot the problem, i appreciate any help. thnx
 Subject: plotting problem From: TideMan Date: 21 Jul, 2012 23:20:10 Message: 2 of 3 On Sunday, July 22, 2012 10:25:17 AM UTC+12, Surafel wrote: > I was trying to plot a graph as follows: > > [x,y]=meshgrid(-5.12:0.01:5.12); > z=round(x)+round(y); > meshc(z) > > the problem is that it plots the graph on the axis for x and y from 0 to 1200, i cant spot the problem, i appreciate any help. thnx But in your call to meshc, you haven't told Matlab what x and y are, so he just uses the indices Try meshc(x,y,z)
 Subject: plotting problem From: Surafel Date: 22 Jul, 2012 00:02:36 Message: 3 of 3 TideMan wrote in message ... > On Sunday, July 22, 2012 10:25:17 AM UTC+12, Surafel wrote: > > I was trying to plot a graph as follows: > > > > [x,y]=meshgrid(-5.12:0.01:5.12); > > z=round(x)+round(y); > > meshc(z) > > > > the problem is that it plots the graph on the axis for x and y from 0 to 1200, i cant spot the problem, i appreciate any help. thnx > > But in your call to meshc, you haven't told Matlab what x and y are, so he just uses the indices > Try > meshc(x,y,z) Right, thnx!