How do I add a Table in App Designer?
이전 댓글 표시
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!
댓글 수: 11
Adam Danz
2018년 11월 16일
There are LOTS of options with UI tables. But once you take the time to go through all of them, you'll realize it's fairly managable.
Here are all the properties you can manipulate with uitables:
And here are some examples of editing uitables in app designer
Sree
2018년 11월 16일
Sree
2018년 11월 17일
Adam Danz
2018년 11월 18일
Categorical inputs work in 2018a but I confirmed that they don't work in 2017b (your version). Anyway, there's lots of examples out there that use numeric, logical, or cell array variables.
Sree
2018년 11월 18일
Adam Danz
2018년 11월 19일
Here's another set of examples of tables built in App.
If you're adding the table within the app instead of prgrammatically, you can set the parameters from within the app. But you can also set the parameters within the code. The examples in the link above mention the propery "ColumnEditable" which enables/disables the user's ability to edit the table (allow input). This was also covered in one of the links I provided in an earlier comment that lists all properties of tables.
Sree
2018년 11월 19일
I agree the documentation could be better in that sense.
- From the App Designer in design mode, right click anywhere on your app background, hover your mouse over 'callbacks', and add a startupFcn callback.
- Go to Code View and you'll see the startupFcn. Add your data to your table there. You can refer to the documentation I shared which will be helpful now that you know how to add the table data.
app.UITable.Data = {1 2 3 4};
Sree
2018년 11월 20일
Adam Danz
2018년 11월 20일
If you share that snippet of code I might be able to help. Also, I'll move the response to the 'answers' section so others may find it useful in the future.
ibenitoseb
2020년 3월 10일
Here is a tutorial on adding rows and columns to tables in app designer:
채택된 답변
추가 답변 (2개)
Paul Macey
2020년 6월 17일
편집: Paul Macey
2020년 6월 17일
0 개 추천
Should really have a way to initalize in properties with at least one empty row.....
Here's what I did in the app startupFcn
app.ColorsUITable.Data = cell(1,length(app.ColorsUITable.ColumnName));
댓글 수: 1
Adam Danz
2020년 6월 18일
That is the way to initialize a table with 1 empty row.
For some data types you can use <missing>
Eric Sargent
2020년 12월 9일
You can edit the RowName, ColumnName and ColumnEditable Properties of a UITable from the Property Inspector of App Designer.
You cannot add Data to a UITable from the Design View of App Designer, you will need to add the data in a StartupFcn (or other callback). For example
function startupFcn(app)
app.UITable.Data = rand(2,4);
end
Will result in:

댓글 수: 2
Kristina Francke
2023년 2월 1일
편집: Kristina Francke
2023년 2월 1일
what if i want to add a value in Column 1 row Two only?
app.UITable.Data(2,1) = value;
카테고리
도움말 센터 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


