App Designer - I cannot add rows when using uitable

9 visualizaciones (últimos 30 días)
Matthew Kyeo
Matthew Kyeo el 21 de Nov. de 2018
Comentada: Adam Danz el 7 de Jul. de 2020
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

Respuesta aceptada

Adam Danz
Adam Danz el 21 de Nov. de 2018
Editada: Adam Danz el 21 de Nov. de 2018
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};
  2 comentarios
LO
LO el 7 de Jul. de 2020
it does not work
rows fail to concatenate although the size is the same and nothing else changes.
the code would work in MATLAB workspace but not app designer (at least not for me)
Adam Danz
Adam Danz el 7 de Jul. de 2020
Yes, this does work in AppDesigner.
If you're having trouble adapting this to your app and want help, provide some more info including
  • What your UITable looks like
  • The code you're using to add rows
  • The matlab release number you're using
  • The full error message, if you're getting one. Otherwise, a detailed description of the problem.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by