[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mesh plot
From: |
Bård Skaflestad |
Subject: |
Re: mesh plot |
Date: |
Fri, 3 May 2013 09:58:34 +0200 |
On Fri, 2013-05-03 at 12:46 +0800, asha g wrote:
> I am trying to get a mesh plot in a program where I think the N and
> iter values are very high.
Your script doesn't refer to either 'N' or 'iter', so the following is a
*guess* that 'N' is numel(x) and 'iter' is numel(z). Furthermore I
*assume* that the quantities 'x', 'y', and 'z' are computed by some
external means, have conformable dimensions and Just Exist[tm] in your
environment.
To pick up every five elements of 'y' in each coordinate direction, you
could do something like this:
i = 1 : 5 : numel(x);
j = 1 : 5 : numel(z);
mesh(z(j), x(i), y(i,j))
Adjust the stride (in this case, '5') appropriately if you want more or
fewer points in your mesh plot.
Note: mesh(z(j), x(i), y(i,j)) is not a misprint. If you use vectors as
coordinates, then number of rows of the third parameter must match the
number of elements of the *second* parameter and the number of columns
of the third parameter must match the number of elements of the first
parameter.
Sincerely,
--
Bård Skaflestad <address@hidden>
- mesh plot, asha g, 2013/05/03
- Re: mesh plot,
Bård Skaflestad <=