Gorga is a carving or sculpture typically found on the exterior of a Toba Batak traditional house. The Batak people use fractal (geometric) dimensions in Batak gorga carvings. In mathematics, repetitive and symmetrical patterns in planes that result from transformations are included in the plane symmetry groups. Ethnomathematics is a cultural approach to the concept of mathematics. A frieze group can be defined as a symmetrical group which arises from a unidirectional translation and subsequently generates a linear pattern that recurs exclusively in a single direction. There are seven different pattern types in the frieze groups. Meanwhile, crystallographic patterns are flat two-dimensional patterns that form a lattice. There are 17 crystallographic types of patterns with five different types of unit lattices. The purpose of this study is to generate motifs for Batak ornaments based on frieze groups and crystallographic groups using a Matlab Graphical User Interface (GUI). A total of 119 new motifs were generated based on seven types of patterns in the frieze groups, namely, F1,F2,F3,F4,F5,F6, and F7. Meanwhile, in the crystallographic groups, 153 new motifs were generated based on nine types of patterns, namely, p1,p2,pm,pg,cm,pmg,pmm,cmm, and pgg. To keep with trends, the new motifs generated can be used in everyday life as decorations or business symbols that are characteristic of the Toba Batak region.