MATLAB: How to add a Table in App Designer

app designerrow namestable

With due respect, the instructions for App Designer are at best counter-intuitive and hermetic. For example, how to create a Table with 3 columns and 3 rows (besides the row of column headings), name columns AND rows, and populate the cells with Default values. Make these cell data entries editable by the user when running the app. The app sould take these Table data (and other data from the Slider, Knob, etc.), run a code that generates a plot.
I am stuck in trying to add Row Names. The User Community advises I need to add Table data first. But there seems to be no place in Design View to add such data!

Best Answer

To add data to a UItable in App Designer, use the startupFcn() after creating the table in the UI.
  1. From the App Designer in design mode, right click anywhere on your app background, hover your mouse over 'callbacks', and add a startupFcn callback.
  2. Go to Code View and you'll see the startupFcn. Add your data to your table there. Refer to the documentation below to change other properties of the table.
app.UITable.Data = {1 2 3 4};