Thread Subject:
plotting problem

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 <mulgor@gmail.com> wrote in message <ae671a5b-9321-4e3b-b607-100f945ff8b2@googlegroups.com>...
> 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!

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
plot Surafel 21 Jul, 2012 18:29:21
mesh Surafel 21 Jul, 2012 18:29:21
rssFeed for this Thread

Contact us