blank UItable for receiving user inputs using app designer

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

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...
The app is for a very specific in-house technical program where the user will know exactly what kind of data goes into the table. Regardless, why couldn't all the data be entered as strings and dealt with as character arrays in each cell?
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?
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.
"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 is <a basic interactive app> using uitable to see as a basic jumping-off point.
There are examples of validating data in the example callback function documentation as guides there.
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...
It's an input and output deck for other code. The other code currently takes input from excel sheets and outputs graphics to a Visio sheet. The data from the Excel sheets is input manually so this interface aims to more conveniently and more reliably replace that. This is why the ability to input data and expand the table is important, since the dataset is not of a known size for each application. Yes each bit of data could be input separately with push buttons to prompt the data collection but that seems like far more steps plus raises the chance of mistakes as the user can't see the full set of data they have already input.
I'm reasonably ok with data verification methods (for an electrical engineer) though I recognise that directly validating at the point of input is more effective and efficient. All the data in the tables is numerical (mostly distances) so I suppose that is simple enough.
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.

Sign in to comment.

Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Products

Release

R2024b

Asked:

on 8 Dec 2025

Commented:

dpb
on 9 Dec 2025

Community Treasure Hunt

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

Start Hunting!