blank UItable for receiving user inputs using app designer
Show older comments
I'm attempting to create a UItable that has a number of rows and columns that are blank and editable so that the user can enter data which will then be saved. I know to use the editable argument but since I have no data in the table at the start, there are no fields for the user to edit. I don't want to use zeros and ideally I'd like a new row to be added each time data is put into the final row. Are these things possible?
7 Comments
dpb
on 8 Dec 2025
You have to at least decide on what kind of data the user can enter into which columns unless you're planning on reading the first entries and deciding programmatically what to do -- with no established ground rules up front, that will be a major task.
I'd suggest the best would be to create a MATLAB table with the column headings defined and of a given data type for each column -- this is doable with the table function that creates a table of a given size without actual data.
Without some more details of just what you are expecting the user to do, both he/she and we are at this point, adrift...
Timothy
on 8 Dec 2025
Walter Roberson
on 8 Dec 2025
If I constructed a table using the table function and assigned the data to the UItable in the app, would updates to the table alter the table itself?
No. You would use callbacks to pull out the current uitable content and assign it to the table.
dpb
on 8 Dec 2025
"why couldn't all the data be entered as strings and dealt with as character arrays in each cell?"
The could be, but then you will have to parse all of them to convert to numeric those that should be in order to use them in the app unless all that is being done is to write to a text file for some other app to read. But, then it would have to be able to handle bad data gracefully because there WILL be mistakes.
If the users are going to be familiar with the expected inputs, it wouldn't be unexpected to them to have the variables defined and with the expected types for each.
There are examples of validating data in the example callback function documentation as guides there.
dpb
on 8 Dec 2025
ADDENDUM: Is this app building an input deck for another code, not entering tabular data, maybe? If so, the table may not be the best idea for that purpose, depending on just what the expected inputs are...
Built a user interface for a couple of different packages in the past; each was quite different in structure because the two applications were totally different in their input structures so the input interface was entirely different between the two as well.
It's hard (as like impossible) to provide really direct input without any klews at all as to those details...
Timothy
on 9 Dec 2025
dpb
on 9 Dec 2025
An alternate way would be to create N numeric edit entry fields and when user completes a set, then update the table instead of editing directly into the table.
Answers (0)
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!