Create segment.m