You can use a multi-line edit box, see: https://www.mathworks.com/matlabcentral/answers/94590-how-do-i-enter-and-evaluate-multiple-lines-in-a-gui-edit-box-that-i-created-in-matlab
Or you can use a uitable, see: https://www.mathworks.com/help/matlab/ref/uitable.html