lab2(no matlab swmtrain func)