This article intends to introduce features of MATLAB (version 6.1 onwards) which lets data be transferred through a serial port for reading it or writing it directly from Matlab. This can be done for supporting several commercial instrumentation interfaces or driving PC COM ports. This work is based on a micro-controlled system designed in such a way that the shape of an object can be recognised by ultrasonic echoes.