[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: counting totals in square grids (meshgrid)

From: Isak Delberth Davids
Subject: Re: counting totals in square grids (meshgrid)
Date: Mon, 14 Dec 2009 07:19:31 +0000

No, I would like Z to be the same dimensions as X and Y. How do I get
them to have the same sizes, and then to do the counting?


2009/12/14 Jaroslav Hajek <address@hidden>:
> On Mon, Dec 14, 2009 at 8:05 AM, Isak Delberth Davids
> <address@hidden> wrote:
>> Dear all,
>> I would like to plot some 3D color-coded density plots, using
>> meshgrid. I have this grid on a 2D surface (generated with meshgrid).
>> Now, I am absolute stuck when it comes to counting the number of
>> points falling in each grid --- I would like to use that number as
>> some kind of a density per grid, which constitutes the 3rd dimension.
>> Here I have a little demonstration:
>> clear, clc, clf;
>> x=rand(10,1)*10;
>> y=rand(10,1)*10;
>> [X Y] = meshgrid(0:1:10,0:1:10);
>> Z =   .......... %must be the number of points in each square grid
>> meshgrid(X,Y,Z)
>> How should Z be defined such that it counts the number of values in
>> each grid of width 1?
>> isak.davids
> First, you should realize that while X and Y are 11x11, there are only
> 10x10 squares in your grid, so Z will be 10x10.
> Is this what you want?
> --
> RNDr. Jaroslav Hajek
> computing expert & GNU Octave developer
> Aeronautical Research and Test Institute (VZLU)
> Prague, Czech Republic
> url:


FULL NAME: Isak Delbert Davids
LOCATION: mostly within 10cm of a keybord
CONTACTS: do not use contact lenses yet
FAX: still has a paper jam

"Views and opinions expressed by my person, are not necessarily true
--- they are simply my views and opinions"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]