matlab 2d curve building