Alphabet sorting vision system

You haven't explained this very well so it is not clear if this is a Matlab, Arduino (or other) problem.

You have blocks identified by A through to H, sorted/positioned randomly and corresponding slots into which these blocks are to be placed.

A component of Matlab identifies each block (somehow?) (and its position?) and passes this information through an interface to an Arduino.

The Arduino has a servo device attached and will, on receiving this identity/position information, move the blocks to their corresponding slots.

Is that it ?

Can you post the code which is running on the Arduino ?