App Designer - I cannot add rows when using uitable

9 ビュー (過去 30 日間)
Matthew Kyeo
Matthew Kyeo 2018 年 11 月 21 日
コメント済み: Adam Danz 2020 年 7 月 7 日
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

採用された回答

Adam Danz
Adam Danz 2018 年 11 月 21 日
編集済み: Adam Danz 2018 年 11 月 21 日
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 件のコメント
LO
LO 2020 年 7 月 7 日
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 2020 年 7 月 7 日
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.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by