MATLAB: App Designer – I cannot add rows when using uitable

uitable

pic.png
Hello, I'm trying to create a table using the App Designer.
I'm using Matlab R2018a on a 64-bit Windows 10 laptop.
> MATLAB Version: 9.4.0.813654 (R2018a)
Since I couldn't find any option to add rows from the UITABLE PROPERTIES menu,
I tried to add it manually. I tried the above code in the startupFcn, however, the rows weren't add at all.
How can I add rows from the UITABLE PROPERTIES menu and how can I add rows dynamically (change row A B C to A B C D E)?
-Regards, Matthew

Best Answer

This was recently addressed here (copied below). You need to add data to the table and that will control the number or rows.
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};