Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Problem 2029. Convert vector datasets to plot with imagesc instead of scatter

Created by Ted

For large datasets this allows much faster plotting.

An irregular 2D spatial sampling is provided in x and y vectors with a data point to plot in vector d. A bin size is also provded in vector b=[dx,dy]

Return a 2D matrix M with minimal empty cells with the correct spatial relationship of d and last value only retained in the event of duplicates.

Example

 b = [6,9];
 x = rand(3333,1)*100*b(1)+1500;
 y = rand(3333,1)*100*b(2)+50000;
 d = sind(sqrt(x.^2+y.^2))./sqrt(x.^2+y.^2);

Return G, a 2D matrix with d binned in rows and columns

Tags

Problem Group

Solution Statistics

1 correct solutions 5 incorrect solutions
Last solution submitted on Dec 03, 2013

Problem Comments