App Designer - I cannot add rows when using uitable

9 Ansichten (letzte 30 Tage)
Matthew Kyeo
Matthew Kyeo am 21 Nov. 2018
Kommentiert: Adam Danz am 7 Jul. 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

Akzeptierte Antwort

Adam Danz
Adam Danz am 21 Nov. 2018
Bearbeitet: Adam Danz am 21 Nov. 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 Kommentare
LO
LO am 7 Jul. 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 am 7 Jul. 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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by