Thanks everyone. After trying out some, the following code works for me. It takes care of plotting data sets of different sizes and plotting them at irregular x-intervals.
x = rand(5,1); y = rand(10,1); z = rand(15,1); Xpos = [1 5 12];
group = [repmat(Xpos(1), 5, 1); repmat(Xpos(2), 10, 1); repmat(Xpos(3), 15, 1)];
boxplot([x;y;z], group,'positions', Xpos, 'labels', Xpos)