help-octave
[Top][All Lists]
Advanced

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

counting totals in square grids (meshgrid)


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

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

***************************************************
FULL NAME: Isak Delbert Davids
LOCATION: mostly within 10cm of a keyboard
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]