09 March, 2014

Create two-dimensional histograms in MATLAB

Sometimes we need two-dimensional histograms for a task, for example to visualize distribution of vectors or points. In MATLAB there is no function designed especially for this operation, so we have to find a workaround, or look for an appropriate solution in the File Exchange section of MATLAB Central. In this post we will use a function designed not for creating histograms but for sparse matrices in a tricky way.

Read more

28 February, 2014

A simple optimization trick: using multiplication instead of division

Multiplication and division are related, similar operators: does it necessarily mean, that they need the same runtime? We will see, that it is worth sometimes to look behind the scenes. The optimization trick described in this post is not really MATLAB related but processor dependent. To understand its background, dig deep into the computer...

Read more

12 December, 2013

A Christmas tree in 46 bytes

As holiday season is near, I came across one of the old source codes: it was written originally in C for a small competition. The goal is to display a Christmas tree with a source code of minimal length...

Read more

Newer posts →Home← Older posts