Count number of points within each cell using scatteredInterpolant
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jack Williams
el 4 de Abr. de 2016
Comentada: Jack Williams
el 4 de Abr. de 2016
Hello
I have an mx3 array of points in XYZ format. I'm using scatteredInterpolant in order to convert these points into a 2D array (image). I first use meshgrid to create a rectangular grid of X and Y values, e.g.:
[XGrid,YGrid] = meshgrid(x,y); % x and y are linearly spaced vectors based on the desired cell size, created using the raw xyz data
F = scatteredInterpolant(x_raw,y_raw,z_raw,'natural');
ZGrid = F(XGrid,YGrid);
For my work it would be very useful to find the number of points from the raw data which fall into each element (pixel) of the resulting image (2D array). In the above code, x and y are linearly spaced vectors obtained from irregularly spaced raw data (x_raw,y_raw,z_raw).
Any help would be greatly appreciated,
Jack Williams
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Scatter Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!